Adsa Practice Questions
Adsa Practice Questions
E2UC503C
1 Write programs for Depth first search (DFS) and Breadth first
search (BFS). Find the complexity of algorithms. Apply DFS and
BFS on
4 What is all pairs shortest path problem. Write a algorithm for all pairs
shortest path. Find its complexity. Apply algorithm on
56. Which of the following order of elements are inserted into an empty
AVL tree so that it is possible to get the above AVL tree.
94,71,86,25,98,83,27,90
B 98,94,90,83,86,25,71,27
C. 86,25,98,83,27,90,71,94
D. None of these
57. In what order we should insert the following elements into an empty
AVL tree so that we don’t have to perform any rotation on it.
1, 2, 3, 4, 5, 6, 7
A. 4, 2, 1, 6, 3, 5, 7
B. 4, 2, 6, 1, 3, 5, 7
C. 6, 4, 5, 7, 1, 2, 3
D. 4, 5, 3, 2, 1, 6, 7
30
/ \
12 45
\
18
Insert: 10,15,40,20,22
Which one of the following is the postorder traversal of the resultant
tree?
(A) 10,15,13,20,22,30,45,40,18
(B) 10,15,12,20,30,22,45,40,18
(C) 10,15,12,20,30,22,45,18,40
(D) None of these
59. Insert the given values in the order in initially empty AVL tree.
34,21,10,27,24,43,15,6
40
/ \
35 53
/ \
20 60