CC5 (Dsa)
CC5 (Dsa)
GROUPA
Answe a four trom the followng 24-8
GROUPB
Write at algorithm to implement qucue using stack Prove that the maxinum 4+4
Wrne atn algorithn to reverse a ink list WVhat is theaded hinary tree? Explain 4+4
with an cLampie
(a) Lmngne a hash-table of stre 10 Using the hash function )-1% 10, and open
addresting wih linear probing for collision resolution, insert the following four
keys one by one isto the ha table (2, 13, 22, 4) Show the contenis of the hash
tabir after each insertion
(b) Prove that a troe with n odes has exactly n - I edges
(b) Based on the representation you suggested above for sparse matrices, now write 4
an algorithm to add two sparse matrices.
4
Reconstruct the original binary tree from the following sequences:
Inorder sequence: D, G, B, H, E, A, F, I, C
Preorder sequence: A, B, D. G, E, H, C, F. I
4
(b) Compare the best and worst case time complexity of scarching an element in a
linked Iist versus an array.