Ad3351 Daa Question Bank
Ad3351 Daa Question Bank
QUESTION BANK
SUBJECT CODE : AD3351 YEAR / SEM : II/III
SUBJECT NAME : Design and Analysis of Algorithms ACADEMIC YEAR : 2024-25
Obtain the time complexity of following recurrence relation in big-oh (O) notation T(n)=2T (n/2)+n
with T(1)=1.(8).
UNIT II
6. What is brute force algorithm? (Nov 23)
7. Write an example problem that cannot be solved by brute-force algorithm. Justify your
answer. List the strength and weakness of Brute
Force Algorithm.
8. Define exhaustive search.
9. Give the general plan of exhaustive search Method.
10. If there are other points of a given set on the straight line through Pi and Pj. which of all these points
need to be preserved for further processing
in a line segment of the convex hull's boundary?
11. Give the general plan for divide-and-conquer algorithms.
12. List the advantages of Divide and Conquer Algorithm.
13. Define Hamiltonian circuit.
14. State the Master theorem and its use.
15. What is the general divide-and-conquer recurrence relation?
16. Define merge sort.
17. List the Steps in Merge Sort.
18. List out Disadvantages of Divide and Conquer Algorithm
19. Define Quick Sort.
20. List out the Advantages in Quick Sort.
21. What are Quick Sort Features?
22. What is the difference between quicksort and merge sort?
23. What is binary search?
24. List out the 4 steps in Strassen’s Method.
25. Define Travelling Salesman Problem.
26. What is asymptotic best-case and worst-case running time of selection sort? (Nov 22)
27. If there are other points of a given set on the straight line through Pi and Pj, which of all these points
need to be preserved for further processing in a line segment of the convex hull's boundary? (Nov
22)
28. List the major variations of decrease-and-conquer technique.
29. How different is the travelling salesman problem from the problem of finding a Hamiltonian circuit?
(Apr 23)
30. For a digraph with n vertices, what is the largest number of distinct solutions, the topological sorting
problem can have? (Apr 24)
PART B
1. Explain Divide and Conquer Method in detail.
2. Discuss Quick Sort algorithm with suitable example.
3. Explain Binary Search in detail with suitable example
4. (i) Write an algorithm using divide and conquer to search an element in a list of numbers. If the
number is not present, the algorithm returns the closest number of the searches number.
(ii) Explain how exhaustive search can be applied to the sorting problem and determine the
efficiency class of such an algorithm
5. What is Strassen’s matrix multiplication and explain how it is solves the problem using divide and
conquer technique
6. (i) Write the DFS algorithm
(ii) Apply the DFS-based algorithm to solve the topological sorting problem for the following
digraph: (Nov 22)
)T(k) + T (n-k-1)+n-1
yield a non-recursive form when k = 1. Give an "O" estimate of this form. Assume that T(0) T(1) =
0 and T(2) = 2. You may = assume that n is even. (5)
) Give the result of partitioning the array with standard Quick sort partitioning (taking the N at the left
as the partitioning element
8. What is pattern searching? Outline the steps in the Rabin-K algorithm for pattern searching with an
example
PART – C
1. Explain in detail about Travelling Salesman Problem using exhaustive search.
2. Explain in detail about Knapsack problem with example.
3. Explain in detail about closest pair problem.
4. (i) Write a pseudocode for a divide-and-conquer algorithm for the exponentiation problem of
computing a where a>0 and n is a positive integer, using recursion.
(ii) Set up and solve a recurrence relation for the number of multiplications made by this
algorithm
(iii) How does this algorithm compare with the brute-force algorithm for this problem?
5. Solve the all-pairs shortest-path problem for the digraph with the following weight matrix:
UNIT III
6. Define dynamic programming.
7. What are the features of dynamic programming?
8. What is the principal difference between dynamic programming and divide- and-conquer
techniques?
9. What are the drawbacks of dynamic programming?
10. Write the general procedure of dynamic programming.
11. Define principle of optimality. (Apr 23)
12. Can we use Prim's algorithm to find a spanning tree of a connected graph with no weights on its
edges?
13. What is control abstraction of greedy method?
14. List the steps required to develop a greedy algorithm.
15. What are the labels in Prim’s algorithm used for? B
16. How are the vertices not in the tree are split into? B
17. What are the operations to be done after identifying a vertex u* to be added to the tree?
18. What are the use of Dijkstra’s algorithm. (Apr 23)
19. What is meant by optimal substructure property of a dynamic programming problem?
20. What is minimum spanning tree?
21. What does a Floyd algorithm do?
22. What is closest pair problem?
23. What is optimal merge pattern?
24. What is Huffman tree?
25. Why the time efficiency class of Warshall's algorithm is inferior to that of the traversal-based
algorithm for sparse graphs represented by their adjacency lists? (Apr 24)
26. Write the pseudo code of Floyd’s algorithm. (Nov 23)
PART – B
1. Explain Dijkstra’s shortest path algorithm.
2. Explain Kruskal's algorithm in detail with appropriate example.
3. Discuss Prim's Algorithm in detail with suitable example.
0 2 ∞ 1 8
6 0 3 2 ∞
∞ ∞ 0 4 ∞
∞ ∞ 2 0 3
3 ∞ ∞ ∞ 0
(Apr 23)
10.
(Dec 22)
PART – C
1. Compare and contrast dynamic programming and greedy method.
2. Write the algorithm for optimal binary search tree and solve the following problem instance to
construct the optimal binary search tree. Keys are a, b, c, d and the probabilities are 0.1, 0.2, 0.4 and
0.3
3. What is multistage graph ? List any three applications of multistage graph.
4. Explain Memory Function algorithm for the Knapsack problem.
5.
UNIT IV
(Apr 23)
23. How can you solve a maximum flow problem of a flow network with multiples sources and or
multiple sinks?
24. Why do we need slack and surplus variables in LPP for solving using simplex method? (Apr 24)
25. State the mathematical formulation of maximum flow problem. (Apr 24)
PART - B
1. Describe stable marriage problem with example.
2. Explain Simplex method with example.
3. Explain Maximum Flow Problem in detail.
4. Explain in detail about Maximum Matching Bipartite graph
5. (a) Starting from the following flow (printed above or to the right of the capacities), perform one
iteration of the Ford-Fulkerson algorithm. Choose a shortest augmenting path, ie, the path with the
fewest number of arcs.
(i)Write down your shortest augmenting path.
ii) Perform the augmentation. What is the value of the resulting flow?
(iii) Is the resulting flow optimal? If so, give a min cut whose capacity is equal to the value of the
flow. If not, give a shortest augmenting path?
6. Solve the following linear programming problems geometrically.
(13)
x20, y20
7. Solve the following instance of the knapsack problem by the branch- and bound algorithm: (Nov
22)
Item weight value
1 10 rs.100
2 7 rs.63
3 8 rs.56
4 4 rs.12 W=16
8.
(
Nov 22)
9.
(
Apr 24)
10.
(
Nov 22)
11.
(Apr 24)
UNIT V
1. Analyze the limitations of algorithm power.
2. What are lower-bound arguments? Or
Write information-theoretic lower bound. (Nov 23)
3. Define Trivial Lower Bounds.
4. Define Information-Theoretic Arguments.
5. Discuss Problem Reduction
6. Define decision trees.
7. Define tractable and intractable. (Nov 22)
8. Give the importance of Hamiltonian circuit problem.
9. Define Traveling salesman problem.
10. What is the use of Knapsack problem?
11. Write about Partition problem.
12. Define Graph-coloring problem.
13. What is LC search and how it is efficient from other search methods in branch and bound algorithms
?
14. Mention the use of deterministic and nondeterministic algorithm.
15. Define Class P
16. Define Class NP?
17. State the use of Class NP-Hard. / List out the properties of NP-Hard Problems
18. Define NP-complete.
19. What are tractable and intractable problems?
20. Explain How can you get the second solution from the first one by exploiting a symmetry of the
board? (Nov 22)
21. What is meant by N-Queen problem? (Apr 23)
22. How does a branch and bound algorithm work? (Apr 23)
23. State Heuristic with an example. (Nov 23)
24. What do you mean by polynomial time approximation algorithm? (Apr 24)
PART - B
1. Describe Briefly about Np-hard and Np-Completeness
2. Describe about Assignment Problem and extend how job assignment problems could be solved.
3. Discuss the 8-Queens problem & discuss the possible solutions.
4. Explain about travelling salesman problem?
5. Explain about LIFO and FIFO search?
6. Solve the following instance of the knapsack problem by the branch-and bound algorithm: (Nov 22)
Item weight value
1 10 rs.100
2 7 rs.63
3 8 rs.56
4 4 rs.12 W=16
7. Apply the nearest-neighbor algorithm to the instance defined by the intercity distance matrix below.
Start the algorithm at the first city, assuming that the cities are numbered from 1 to 5 and Compute
the accuracy ratio of this approximate solution. (Nov 22)
PART C
1. Describe in detail about Branch and Bound Problem
2. Illustrate about Hamiltonian Circuit Problem
3. (i) Illustrate the algorithm for the instance n = 6, M = 30 and W = (5, 10, 12, 13, 15, 18). Draw
possible state space tree.
(ii) Prove that TSP problem is NP complete, assuming that Hamiltonian problem is NP complete
4. Suppose you are given an array A of size 'n' that either contains all zeros or 2n/3 zeros and n/3 ones in
some arbitrary order. Your problem is to determine whether contains any ones?
(i) Give an exact lower bound in terms of 'n' (not using asymptotic notation) on the worst-case
running time of any deterministic algorithm that solves this problem. Give a randomized algorithm
that runs in O(1) time and gives the right answer with probability at least 1/3.
(ii) Give a randomized algorithm that runs in O(1) time and gives the right answer with probability
at least 5/9.