Você está na página 1de 19

ANAYSIS AND DESIGN OF ALGORITHMS BLUE PRINT

UNIT

NUMBER
OF
TEACHING
HOURS

PART A2 MARKS

PART B5 MARKS

PART C10
MARKS

TOTAL

3*2=6

1*5=5

11

3*2=6

1*5=5

11

10

2*2=4

1*5=5

1*10=10

19

10

1*2=2

2*5=10

1*10=10

22

12

2*2=4

2*10=20

24

12

2*2=4

2*5=10

1*10=10

24

2*2=4

1*5=5

TOTAL

60

15*2=30

8*5=40

5*10=50

120

Module-1 Introduction
2 marks

[3 has to be picked]

1. What is an algorithm?
2. List the characteristics of the algorithm.
3. What is program verification?
4. What is debugging?
5. What is profiling?
6. What is analysis of an algorithm?
7. What is performance analysis of an algorithm?
8. What is posteriori testing?
9. Distinguish between priori and posteriori testing.
10.
Distinguish between performance analysis and performance
measurement.
11.
Define time complexity of an algorithm.
Or
What is time complexity of an algorithm?
12.
Define space complexity of an algorithm.
Or
What is space complexity of an algorithm?
13.
Define big-oh(O) notation. Give one example.
Or
What is big-oh(O) notation? Give one example.
14.

Define notation. Give one example.


Or

What is notation? Give one example.

15.

Define theta

notation. Give one example.

Or
What is theta

notation? Give one example.

16.
Given f(n) = 5n+2, prove that f(n) = (n).
17.
Given f(n) = 5n+3, prove that f(n) =O(n).
18.
Given f(n) = 5n+2, prove that f(n) = (n).
19.
Given f(n)= 20n-3, prove that f(n) = O(n).
20.
What is operation count and step count?
21.
Let f(n) = 100n+5, Express f(n) using theta.
22.
Arrange the following time complexities in ascending order O(1),
O(n), O(2), O(n), O(logn), O(nlogn).

5 marks

[1 has to be picked]

1. Explain space complexity of an algorithm with the help of an example.


2. Explain how time complexity is computed.
3. Explain the characteristics of algorithm.
4. Explain debugging.
5. Explain profiling.
6. Discuss 5 distinct research areas in the study of algorithms.
7. Briefly explain performance measurement.
8. Write the recursive algorithm for finding the sum of array elements and
analyze the time complexity.
9. Write an algorithm to find GCD of two numbers.
10.

Write an algorithm to generate first N Fibonacci numbers.

11.

List out various asymptotic notations and their significance.

12.

Explain the active areas of study of algorithms.

13.
Demonstrate that the computing time to multiply the square
matrices is of O(n3).
Module-2: Introduction

2 marks:

[3 has to be picked]

1.
2.
3.
4.

Give the algorithm for calculating the sum of elements in the array.
Give the algorithm for matrix addition.
Give an algorithm for matrix subtraction.
Give the recursive algorithm for calculating the sum of elements of an
array.
5. Give the recursive algorithm for generating first N Fibonacci numbers.
6. Give the algorithm (recursive) for finding the factorial of a number.
7. Give the algorithm for insertion sort.
8. Give the algorithm for bubble sort.
9. Give the time complexity of bubble sort algorithm.
10.
Give the time complexity of selection sort algorithm.
11.
Give the algorithm for linear search.
12.
Give the algorithm for sequential search.
13.
Give the time complexity of linear search.
14.
Give the time complexity of algorithm to calculate the factorial of
a number.
15.
Give the time complexity of recursive algorithm to calculate the
factorial of a number.
16.
Give the time complexity of recursive algorithm for generating
first N Fibonacci numbers.
17.
Give the algorithm to find the transpose of a matrix.
18.
Explain best case of an algorithm.
19.
Explain worst case of an algorithm.
20.
Explain average case of an algorithm.
21.
Give the algorithm for finding the maximum for a given set of
numbers.
22.
Give the algorithm for finding the minimum for a given set of
numbers.
5 marks:

[1 has to be picked]

1. Give the insertion sort algorithm and analyze the time complexity of
the algorithm.
2. Give the bubble sort algorithm and analyze the time complexity.
3. Give the algorithm selection sort (a,n) and analyze the time
complexity.
4. Give the complexity and algorithm for straight maxmin.
5. Give the algorithm for binary search.

6. Explain evaluation of univariate polynomial (both straight forward


evaluation and horners rule) write the algorithm for both.
7. Write the recursive algorithm for finding the maximum and minimum
in an array and analyze the time complexity of the algorithm?
8. Derive the time complexity for worst case of iterative binary search
algorithm.
9. Derive the time complexity for average case of iterative binary search
algorithm.
10.

Give recursive maximum algorithm.

11.
Derive the time complexity of recursive of recursive maxmin
algorithm.
12.

Give the algorithm for straight forward evaluation of polynomial.

13.
Give the algorithm for evaluating a polynomial using horners
method.
14.

Explain selection sort technique with the help of an example.

15.
Write the algorithm for selection sort and give the time
complexity.
16.
Explain bubble sort technique with an example(consider at least
5 unsorted elements).
17.

Write the algorithm for bubble sort technique.

18.

Analyze the time complexity of bubble sort.

19.
Explain insertion sort technique with the help of the
example(consider at least 5 elements).
20.

Write the algorithm for insertion sort.

21.

Analyze the time complexity of insertion sort.

22.

Explain binary search technique with the help of an example.

23.

Write recursive binary search algorithm.

Module -3 Divide & conquer


2 Marks

[2 has to be picked]

1. Define divide and conquer approach.

2. Give the control abstraction of DAnd C.


3. Give the computing time of DAnd C.
4. Give the iterative binary search algorithm.
5. Give the time complexity of merge sort algorithm.
6. Give the time complexity of quick sort.
7. What are the advantages of divide and conquer method?
8. What are the disadvantages of divide and conquer method?
9. If T (n) = T (n/2) +b, then prove that T (n) =O (logn).
10.
Which of the following algorithms is NOT a divide & conquer
algorithm by nature?
a. Mergesort
b. Quicksort
c. Strasens matrix multiplication
d. Travelling salesman.
11.
List any 4 algorithms that is divide & conquer algorithm by
nature
5 marks:

[1 has to be picked]

1. Explain divide and conquer method.


2. Consider the array of ten elements
a[1:10]=(310,258,179,652,351,423,861,252,450,520)
Trace the merge sort algorithm.
3. Give the recurrence relation and derive the time complexity of merge
sort algorithm.
4. Derive the best case time complexity of quick sort algorithm.
5. Derive the worst case time complexity of quick sort algorithm.
6. Derive the complexity of strassens matrix multiplication algorithm.
7. If T(n) = T(n/2)+2, then prove that T(n)=3n/2-2 by substitution
method.
8. Consider the array of ten elements
a[1:10]=(310,258,179,652,351,423,861,252,450,520)
Trace the quick sort algorithm.
9. Give the recurrence relation relation and derive the time complexity of
quicksort algorithm.

10 marks: [1 has to be picked]

1. Explain how merge sort algorithm works by considering an example of


at least 8 elements
2. Write algorithms for merge sort.
3. Given the following elements
a[1:10]=310,285;179,652,351,423,861,254,450,520 Explain how
merge sort works.
4. Give the recursive call tree of merge sort-algorithm.
5. Explain with the help of an example how quick sort works.
6. Give the algorithm for quick sort.
7. Analyze the worst case time complexity of quick sort.
8. Explain Stassen matrix multiplication.
9. Analyze the time complexity of strassens matrix multiplication.
10.
Explain multiplication of 2 long integers with an example and
Analyze the time complexity

Module-4 Greedy approach


2 marks:
1.
2.
3.
4.
5.
6.
7.
8.
9.

[1 has to be picked]

Explain greedy method of solving a problem.


Give the control abstraction of greedy method.
Mention the constraints for optimal storage on tapes problem.
What is knapsack problem? Mention its constraints.
What are the strategies to solve a knapsack problem?
What is a spanning tree?
Define minimum spanning tree.
What are the advantages and disadvantages of greedy algorithm?
What is undirected graph? Give an example.
Or
Define undirected graph. Give an example.

10.

What is directed graph? Give an example.


Or

Define directed graph. Give an example.


11.
Define subgraph. Give an example.
12.
What are adjacent and incident vertices?
13.
What is indegree and outdegree?
14.
What is a connected graph? Give an example.
15.
What is a strongly connected graph? Give an example.
16.
What is a weighted graph? Give an example.
17.
What is a path?
18.
What is cycle? Give an example.
19.
What is an adjacency matrix?
20.
Give the differences between greedy method and dynamic
programming method.

5 Marks

[2 has to picked]

1. Explain greedy technique and write the control abstraction.


2. Write and explain the algorithm for greedy knapsack problem.
3. Explain job scheduling with deadlines.
4. Write and explain algorithm for knapsack proble.
5. Solve the greedy knapsack problem for an optimal solution also
compute the maximum profit earned M=40,N=4
weights[w1,w2,w3,w4]=[20,25,10,15] profits [p1,p2,p3,p4] =
[20,40,35,45] according to increasing order of weights.
6. Write prime algorithm.
7. Write kruskals algorithm.
8. Give the algorithm for single source shortest path. Give the time
complexity of the algorithm.
9. Solve the greedy knapsack problem for an optimal solution also
compute the maximum profit earned M=20,N=7
weights[w1,w2,w3,w4,w5,w6,w7]=[2,5,4,6,3,2,1] profits [p1,p2,p3,p4]
= [20,40,35,20,15,25,45] according to decreasing order of profits.
10.
Solve the greedy knapsack problem for an optimal solution also
compute the maximum profit earned M=40,N=4
weights[w1,w2,w3,w4]=[20,25,10,15] profits [p1,p2,p3,p4] =
[20,40,35,45] according to decreasing order of Pi/Wi.
11.
Solve the greedy knapsack problem for an optimal solution also
compute the maximum profit earned M=20,N=7
weights[w1,w2,w3,w4,w5,w6,w7]=[2,5,4,6,3,2,1] profits [p1,p2,p3,p4]
= [20,40,35,20,15,25,45] according to increasing order of profits.
12.
Solve the greedy knapsack problem for an optimal solution also
compute the maximum profit earned M=20,N=7
weights[w1,w2,w3,w4,w5,w6,w7]=[2,5,4,6,3,2,1] profits [p1,p2,p3,p4]
= [20,40,35,20,15,25,45] according to decreasing order of Pi/Wi.

10 Marks [1 has to be picked]

1. Consider a knapsack problem of finding the optimal solution where


M=40,N=4 weights p[w1,w2,w3,w4]=[20,25,10,15] profit[p1,p2,p3,p4]
2. Solve the following 0/1 knapsack problem using greedy method M=40,
N=4 weights p w1,w2,w3,w4 20,25,10,15 profit p1,p2,p3,p4
3. What is a spanning tree? What is minimum cost spanning tree? Write
prims algorithm to find minimum cost spanning tree.
4. Write kruskals algorithm to find minimum cost spanning tree.
5. Find the minimum weight spanning tree using prime algorithm
6. Find the minimum weight spanning tree using kruskals algorithm
7. Find out the shortest path using dijikstras algorithm for below graph
8. Explain job sequencing using deadlines in detail
9. Give the algorithm of job sequencing using dead line give one
example.

Module-5 Dynamic programming

2 marks:

[2 has to be picked]

1. What is dynamic programming?


2. What is travelling sales man problem?
3. Compare greedy algorithm with dynamic programming method.
4. Define principle of optimality.
5. What is a graph.
6. What is a loop.
7. Define path.
8. Define weighted graph.
9. Define complete graph.
10.
Define connected graph.
11.
Define cyclic graph.
12.
Define acyclic graph.
13.
Define indegree and outdegree of a graph.
14.
What is a subtree?
15.
Explain cost adjacency matrix with an example?

16.

Explain adjacency list with an example.

10 marks: [2 has to be picked]


1. Explain dynamic programming design strategy and write the principle
of optimality
2. Explain general method salesman problem? Explain give one example
How can this problem be solved using dynamic programming?
3. Find the optimal tour cost for below graph(tsp problem)
0
5
6
8

10
0
13
8

15
9
0
9

20
10
12
0

4. Explain optimal parameterization of product of sequence of matrices


with an example
5. Explain chained matrix multiplication with an example
6. Let M1=13x5,M2=5x89,M3=89x3,M4=3x34 and n=4,
D=[d0,d1,d3,d4]=[13,5,89,3,34] obtain the optional combination
7. Find the optimal tour cost for travelling salesman problem
0
5
6
13

15
0
8
8

10
9
0
9

20
10
20
0

8. Explain travelling salesman problem.


9. Define the following terms
a. Adjacency matrix
b. Adjacency list
c. Directed graph
d. Simple path
e. Simple cycle
10.
What is dynamic programming? Differentiate between divide and
conquer method and dynamic programming.

Module-6 Back tracking

2 marks:

[2 has to be picked]

1. Give the algorithm (recursive) for general backtracking method.


2. What is a live node?
3. Give the control abstraction of back tracking method.
4. Give the constraints used in back tracking.
5. Mention the implicit and explicit constraints of 8 queens problem.
6. Mention implicit and explicit constraints of 4 queens problem.
7. Define dead node.
8. Define expansion node.
9. What is 4 queens problem?
10.
State 8 queens problem.
11.
Define solution space.
12.
Define bounding function.

5 marks:

[2 has to be picked]

1. Explain general back tracking method and write control abstraction for
back tracking.
2. Give the iterative back tracking control abstraction.
3. What is 4 queens problems? Explain with the help of diagram.
4. What is 8 queens problem? Explain with the help of a diagram.
5. Write the algorithm for N queens problem.
6. Trace N queens algorithm where N=4.
7. Explain how the four queens problem can be solved using
backtracking.
8. Give the algorithm for finding all solutions of N queens problem.
9. Briefly explain the branch and bound method.
10.

Define the following terms

a. Live node.
b. Dead node.
c. E-node.
d. Solution space.
e. Bounding function.

10 marks: [1 has to be picked]


1. Explain general backtracking method.
2. Give iterative backtracking control abstraction.
3. Give recursive backtracking control abstraction.
4. Explain 8 querns problem.
5. Give the algorithm for n queens problem.
6. Give general method of branch & bound technique.
7. Give the control abstraction of branch & bound.
8. Explain LC-search.
9. Give the control abstraction of LC-search.
10.

Explain deterministic and non-deterministic algorithms.

11.

Give non-deterministic algorithm for sorting.


Module-7 Lower Bound theory

2 marks: [2 has to be picked]


1. Define NP hard problems.
2. Describe the relationship between P and NP.
3. What is deterministic algorithm?
4. Define class P and class NP.
5. What are the two types of branch and bound technique?
6. What is non-deterministic algorithm?
Or

What is a non-deterministic machine?


7. What is lower bound theory?
8. Define decision problem.
9. Define polynomially bounded.
10.
Define graph coloring.

5 marks:

[1 has to be picked]

1. What is non-deterministic algorithm? Explain briefly give nondeterministic search algorithm.


2. Briefly explain the classes NP hard and NP complete.
3. Give the non-deterministic algorithm for sorting.
4. Explain NP hard problems/ classes.
5. Explain NP complete problems.

JAIN UNIVERSITY
MODEL QUESTION PAPER
Analysis and Design of Algorithms (4BCA2)
IV semester BCA
PART A

Answer any 10 questions. Each carries 2 marks.


10*2=20

1. What is an Algorithm?
2. Define Theta notation.
3. What is profiling?
4. Write an Algorithm to print first n elements in a Fibonacci series.
5. Write insertion sort algorithm.
6. Derive time complexity of bubble sort algorithm.
7. What are the disadvantages of divide and conquer method.
8. Give the control abstraction of divide and conquer method.
9. What are the advantages of greedy approach?
10.
What is an adjacency matrix?
11.
Define a path. Give one example.
12.
What is e-node and dead node?
13.
What are the two types of constraints for Backtracking?
14.
What is NP-Hard problem?
15.
What is NP-complete problem?

PART-B
Answer any 6 questions. Each carries 5 marks.
6*5=30
1. What is time complexity? With the help of an example explain how
time complexity is calculated using step count method.
2. Derive the time complexity of recursive binary search algorithm.
3. Give Quick sort Algorithm.
4. Solve the following 0/1 knapsack problem using greedy method.
( Strategy 3 only i.e order by pi/wi ). M=40,N=4
Weights: w1, w2, w3, w4 = 20, 25, 10, 15
Profits: p1, p2, p3, p4 = 50, 40, 85, 45
5. Give Kruskals algorithm.
6. Give the algorithm for solving n queens problem using Backtracking
method.
7. Explain Backtracking. Give the control abstraction of Backtracking.
8. Give the Non-deterministic algorithm for sorting.
PART-C

Answer any 3 questions. Each carries 10 marks.


3*10=30

1.

a. Explain Merge sort methodology with an example (not less than 6


elements).
(5+5)

b. Write Merge sort algorithm.


2. Find the minimum spanning tree for the following graph using Prims
algorithm.

1
8

11
7

9
2

13
14

14

15
3

4
12

3. Find the optimal tour cost for the below graph (Traveling salesman
problem) using branch and bound method.

4
1

4
1

3
1
2

3
5

4. Explain Dynamic programming solution to chained matrix


multiplication with the help of an example.
5. Find the single source shortest path for the following graph using
Dijikstras Algorithm.

10

1
1

3
6

2
5

3
2

Você também pode gostar