DAA Unitwise Question Bank
DAA Unitwise Question Bank
Unit-1
6. Develop an algorithm to solve the Towers of Honai problem with n disks with three
towers.
7. Write an algorithm for Binary search and analyze the algorithm for its time complexity
9. Write Randomized algorithm for Quick sort. Analyze its performance with quick sort
algorithm without randomization.
8. Write Prim’s algorithm to generate minimum cost spanning tree for the given
Graph
9. Develop the control abstraction and derive the time expression for the divide and conquer
logic.
10. Develop the quick sort algorithm and trace it for an example.
11. Explain single source shortest path Problem with example.
12. Explain the method of vertex splitting with an example.
Unit-3
7. Illustrate the reliable system design using a dynamic programming approach in detail.
8. Use the function OBST to compute w(i,j), r(i,j), and c(i,j), 0 ≤ i < j ≤ 4, for the
identifier set (a1, a2, a3, a4) = (do, if, int, while) with p(1 : 4) = (3, 3, 1, 1) and
q(0:4)=(2,3,1,1,1). Using the r(i,j)’s construct the optimal binary search tree
9. Identify the possible binary search trees for the identifier set {do, while, if, else}.
10. Write dynamic programming solution for the traveling sales person problem for the
network with the cost adjacency matrix. Assume node 1 as the home city.
Unit-4
1. Develop an algorithm to solve the problem of the sum of subsets.
With m = 35, run SumOf Sub on the data
(a) w = {5,7,10,12,15,18,20},
(b) w = {20,18,15,12,107,5}
(c) w = {15,7,20,5,18,10,12}.
Are there any differences in the computing times?
2. Let w = {5,7,10,12,15,18,20}and m=35. Find all possible subsets of w that sum
to m. Do this using SumOfSub. Draw the portion of the state space tree that is generated.
3. Develop the algorithm to solve the 8-queen problem with suitable diagrams.
4. Illustrate the 4-Queen problem-solving with suitable diagrams.
5. Explain graph coloring with examples.
6. Develop an algorithm to generate an m-coloring graph.
7. Develop the algorithm for recursive backtracking with an example
8. Develop an algorithm to find all Hamiltonian cycles in graphs.
9. Describe the algorithm for Hamiltonian cycles and Determine the order of magnitude
of the worst-case computing time for the backtracking procedure that finds all
Hamiltonian cycles.
10. Compare planar and non-planar graphs with examples.
11. Develop the backtracking solution to the 0/1 Knapsack problem.
Unit-5
1. Develop an algorithm for non-deterministic knapsack.
2. List and explain any two NP-complete problems.
3. Compare the features of deterministic and non-deterministic algorithms with
examples.
4. Develop a non-deterministic algorithm to search for an element in an array.
5. Explain the relation among P, NP, Np-complete and NP-hard problems.
6. Explain the Cook’s theorem.
7. Develop a non-determinsitic clique pseudocode.
8. Using an example prove that, satisfiability of boolean formula in 3-Conjunctive
Normal form is NP-Complete.
9. Is Travelling salesman problem NP-hard or NP-Complete? Justify your answer.
10. Show that the HAMILTONIAN_CYCLE problem on directed graphs is NP complete
11. Explain circuit satisfiability problem with a circuit diagram. Show that circuit
satisfiability problem is NP- hard
12. Illustrate the Node cover decision problem with a neat sketch.
Faculty signature