ADA Questions For Prefinal
ADA Questions For Prefinal
ADA Questions For Prefinal
2. What is an algorithm?
10. Write the general method and Control Abstraction of Greedy method
12. Define i) Principles of optimality ii) Feasible solution iii) Optimal solution.
14. Write the Control Abstraction of Least – Cost Branch and Bound
15. Define: i) LC – Search ii) Branch and Bound (BB) iii) FIFO – BB
2. Explain Merge sort (Stable sort (or) Not in-place) algorithm and trace this algorithm for
b) Derive the time complexity of Merge sort algorithm for all cases
b) Give the statement of sum –of subsets problem. Find all sum of subsets for n=4, (w1, w2, w3, w4) =
(11, 13, 24, 7) and M=31.Draw the portion of the state space tree using fixed – tuple sized approach
4. a) What are union and find operations? Explain with suitable examples.
5. Consider n=4 & (q1,q2,q3,q4)=(do, if, int, while) the values for p’s & q’s are given as
p(1:4)=(3,3,1,1) & q(0:4)=(2,3,1,1,1). Construct the Optimal Binary Search tree.
b) Write a function to compute lengths of shortest paths between all pairs of nodes for the given adjacency
matrix.
0 6 13
. 8 0 4
5 ∞ 0
7. a) Define Minimum Spanning Tree(MST). Explain Krushkal’s Algorithm to find MST with example.
b) Explain Prim’s Algorithm to find Minimum Spanning Tree with example. What is its Time
Complexity?
8. Define Greedy knapsack. Find the optimal solution of the Knapsack instance n= 7, M=20,
9. Draw the portion of state space tree generated by LCBB for the following instance of