G4001042014
G4001042014
2. What are the common structures used to store graphs? Explain with examples.
3. a) Draw a complete tree to level 4. How many different nearly complete trees can
exist at level 4?
b) Show the breadth first traversal of the tree in the following figure.
B F
C G
H I
D E
4. Use linear probing , a hash table with b=13 buckets, and the hash function f(k)= k% b.
Start with the empty hash table and insert pairs whose keys are 7, 42, 25, 70, 14, 38,
8, 21, 34, 11.
iv) What is the loading factor of your table after the last insert?
1 of 2
www.ManaResults.co.in
|''|''|||''|'''|||'|
Subject Code: G4001/R13
ii) Heapify the tree. Show the result in both tree and array format.
iii) Insert the elements 15, 20 and 45 using bubbling up process. Show the max
heap following each insert.
6. Construct a binary search tree by inserting the keys 4, 12, 8, 16, 6, 18, 24, 2, 14, 3.
Draw the tree following each insert. From the tree delete keys 6, 14, 16 and 4. Draw
the search tree after each deletion.
b) Describe Single rotation and double rotation in deleting an element in an AVL tree.
8. Start with an empty red black tree and insert the following keys in the given order: 20,
10, 5, 30, 40, 57, 3, 2, 4, 35, 25, 18, 22, 21. Draw the figures depicting your tree
immediately after insertion and following the rebalancing rotation or color change.
Label all nodes with their color and identify the rotation type.
****
2 of 2
www.ManaResults.co.in
|''|''|||''|'''|||'|