Important Questions
Important Questions
UNIT-I
1) a) Define and explain the terms “Time complexity” and “Space complexity” of algorithms.
b) Explain about Amortized Analysis.
UNIT-II
1) a) Write and explain the control abstraction for Divide and Conquer.
b) Briefly explain Merge Sort Algorithm with suitable example and derive its Time Complexity.
2) Show how the Quick sorts the following sequences of keys in ascending order
22, 55, 33, 11, 99, 77, 55, 66, 54, 21, 33)
3) Write and explain Divide and conquer algorithm for computing the no of levels in a binary
tree.
4) Apply Quick sort to sort the list. E, X, A, M, P, L, E, in alphabetical order . Draw the tree of
recursive calls made.
UNIT-III
5) (a) If objects are selected in order of increasing vi/wi then prove that the algorithm
knapsack finds an optimal solution.
(b) Write an algorithm for Single source shortest path. Explain with an example
UNIT-IV
1) a) Solve the following 0/1 Knapsack problem using dynamic programming P= (11, 21, 31,
33), W= (2, 11, 22, 15), C=40, n=4.
b) Consider three stages of a system with r1=0.3, r2=0.5, r3=0.2 and c1=30, c2=20, c3=30
Where the total cost of the system is C=80 and u1=2, u2=3, u3=2 find the reliability design.
2) (a) Define merging and purging rules in o/1 Knapsack problem.
(b) Write an algorithm for all pairs shortest path. Explain with an example
3) Consider 4 elements a1 < a2 < a3 < a4 with q0=0.25 , q1=3/16 , q2=q3=q4=1/16. p1=1/4 ,
p2=1/8 p3=p4=1/16.
(i) Construct the optimal binary search tree as a minimal cost tree.
(ii) Construct the table of values Wij, Cij, Vij computed by the algorithm to compute the
roots of optimal subtrees
5) (a) Find the shortest tour of TSP for the following graph using dynamic Programming
(b) What is the best method between greedy method and dynamic programming to solve single
source shortest path problem? Justify your answer with example.
UNIT-V
2) What is Graph coloring? Write an algorithm for it and explain with an example.
3) Write an algorithm for how Eight Queen’s problem can be solved using back tracking and
explain with an example
4) Consider a set S= {5, 10, 12, 13, 15, 18} and d= 30. Solve it for obtaining sum of subset
UNIT-VI
1) a) Define the terms Branch and Bound. Explain the principles of:
i. Control Abstraction for LC-search, ii. FIFO Branch & Bound.
b) Solve 0/1 knapsack problem using Branch and Bound.
2) What is bounding? Explain the following with an example.
(a) Job Sequencing with Deadlines
(b) FIFO Branch and Bound
(c) LC Branch and Bound
3) (a) Draw the portion of state space tree generated by LCKNAP for the Knapsack instances:
n=5, (P1,P2,…..P5) = (10, 15, 6, 8, 4) , (W1,W2,….W5) = (4, 6, 3, 4, 2) and M = 12.
(b) Write about Row Minimization in TSP
4) Find the shortest tour of TSP for the following graph using Branch and Bound technique