Documente Academic
Documente Profesional
Documente Cultură
_______________________________________________________________________.
Q. 2 a. Explain Prim’s algorithm and apply the same on the following graph to find the
Minimum Spanning Tree. (6)
10
A D 2
15
C 20
10 4 2 F
30
15
B E
10
Q.3 Discuss the applications of BST and construct the BST with the following data:
STA, ADD, LDA, MOV, JMP, TRIM, XCHG, MUI, DIV, NOP, IN, JNZ
Show all the steps. (10)
If the data is huge and searching is the more frequent operation then BST is the
suitable data structures. Application can be to store the dictionary of the words.. (2)
All the steps while constructing the BST should be shown with diagrams. (8)
If directly the BST is drawn then only one mark should be allotted for that.
Q.4 Explain all the steps of Dijkstra’s algorithm. Apply the same to find out the shortest
path from F to A and also find the length of the shortest path.
(10)
10
A D 2
15
C 20
10 4 2 F
30
15
B E
10
Step by step details along with the calculation details should be shown with explanation.
b. Discuss the term “Efficiency of the algorithm” and explain the parameters on
which it depends. (5)
Answer should start with the factors affecting the efficiency ( time and space ) and
then various types of times and memories till it reaches to “size of data”.
Q.6 a. Explain the quick sort algorithm and trace the same on the following data. Show
each step with explanation:
21, 32, 65, 2, 32, 1, 98, 53, 42, 12 (6)
Explanation of Quick sort algorithm: 2 marks
Showing each step while tracing the given list: 4 marks
b. Discuss the need of using AVL tree as a data structure (4)
Answer should contain the drawbacks of unbalanced tree and then the advantages
of using AVL