Test3 CSE205 - K18FR
Test3 CSE205 - K18FR
Test-3 (K18FR)
t R i e f c
2. Given the Sequential Representation of the AVL Search Tree, perform the Insertion/Deletion according to the operation
mentioned in the table, show the rotation and fill the details in the table after the rotation:
Sequential Representation of the Given AVL Operation to be Rotation Sequential Representation of the AVL after the
Tree performed Required operation
(ii) 80, 30, 90, 10, 60, --, 95, --, --, 40, 70 INSERT 65
(iii) 80, 65, 90, 30, 75, --, 95, --, --, 70 DELETE 95
3. Given a hash table of size 12, use Division Method to map the following keys and apply Quadratic Probing for Collision
Resolution.
K = {98, 33, 69, 116, 53, 11, 229, 45}
Complete the hash table below:
0 1 2 3 4 5 6 7 8 9 10 11
λs =
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)
CSE205: Data Structures & Algorithms
Test-3 (K18FR)
l I t e s Y
Given the Sequential Representation of the Heap, perform the Insertion/Deletion according to the operation mentioned in the table,
show all the steps and fill the details in the table after each operation:
Sequential Representation of the Given Heap Operation to be performed Sequential Representation of the Heap after the
operation
(i) P, M, F, H, B, D, A, C, G DELETE
(ii) P, M, F, H, B, D, A, C, G INSERT O
(iii) 20, 60, 62, 60, 65, 70, 80, 80, 70, 70, 80, 70 DELETE
3. Given a hash table with indexes 1 to 13, use Division Method to map the following keys and apply Double Hashing for Collision
Resolution using H`(K) = K mod 11 + 1.
K = {98, 33, 69, 117, 56, 138, 160}
Complete the hash table below:
1 2 3 4 5 6 7 8 9 10 11 12 13
λs =
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)
CSE205: Data Structures & Algorithms
Test-3 (K18FR)
r a b i t g
2. Given the Sequential Representation of the AVL Search Tree, perform the Insertion/Deletion according to the operation
mentioned in the table, show the rotation and fill the details in the table after the rotation:
Sequential Representation of the Given AVL Tree Operation to be Rotation Sequential Representation of the AVL after the
performed Required operation
(i) 30, 10, 50, --, 20, 40, 80, --, --, --, --, --, --, 70, 90 INSERT 60
(ii) 40, 10 70, --, 20, 50, 80, --, --, --, --, 45, 60, --, 75 DELETE 20
λU = 5
6
#Average Number of Probs for Successful Search
7
λs = 8
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)
CSE205: Data Structures & Algorithms
Test-3 (K18FR)
t r i c p k
2. Given the Sequential Representation of the Heap, perform the Insertion/Deletion according to the operation mentioned in the
table, show all the steps and fill the details in the table after each operation:
Sequential Representation of the Given Heap Operation to be performed Sequential Representation of the Heap after the
operation
(i) B, E, F, H, M, H, S, P, R, S, K DELETE
(ii) E, H, F, K, M, J, S, R, P, T INSERT G
(iii) 10, 30, 40, 40, 60, 50, 40, 50, 55 DELETE
(iv) 30, 40, 40, 50, 60, 50, 50, 40, 60 INSERT 30
3. Given a hash table of size 100, use Folding Method to map the following keys and apply Quadratic Probing for Collision
Resolution.
K = {98652, 1897, 84, 39189, 1433, 14006, 18002}
Complete the hash table below:
Index
Key
λs =
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)
CSE205: Data Structures & Algorithms
Test-3 (K18FR)
a u n t p s
2. Given the Sequential Representation of the AVL Search Tree, perform the Insertion/Deletion according to the operation
mentioned in the table, show the rotation and fill the details in the table after the rotation:
Sequential Representation of the Given AVL Operation to be Rotation Sequential Representation of the AVL after the operation
Tree performed Required
(ii) 50, 20, 70, --, 30, 60, 80, --, --, --, --, --, 65 DELETE 30
(iii) 30, 10, 40, 5, 20, 35, --, --, 8, 15, 25 INSERT 18
6
λs =
7
8
# Average number of probs for Unsuccessful Search
9
10
λU =
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)
CSE205: Data Structures & Algorithms
Test-3 (K18FR)
b a d i t y
2. Given the Sequential Representation of the Heap, perform the Insertion/Deletion according to the operation mentioned in the
table, show all the steps and fill the details in the table after each operation:
Sequential Representation of the Given Heap Operation to be performed Sequential Representation of the Heap after the
operation
(i) 30, 60, 50, 70, 80, 80, 85, 80, 75 DELETE
(ii) 50, 60, 70, 70, 80, 80, 85, 80 INSERT 55 A. 50, 55, 70, 70, 80, 80, 85, 80, 60
(iii) C, H, K, L, K, P, T, R, N DELETE
(iv) H, K, K, L, M, T, Q, T INSERT M A. M, H, K, K, L, M, T, Q, T
B. H, K, K, M, L, T, Q, T, L
C. H, K, K, L, M, T, Q, T, M
D. None of These
3. Given a hash table with indexes 1 to 15, use Division Method to map the following keys in the given hash table:
K = {93, 32, 129, 71, 12, 45, 259, 83}
Use Double Hashing for Collision Resolution using the Hash Function H`(K) = K mod 7 + 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)
Average number of probs for Unsuccessful Search =
λU =
Ravi Kant Sahu, Assistant Professor @ Lovely Professional University, Phagwara (Punjab)