• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | GATE CS 2021 | Set 1 | Question 57

Consider a dynamic hashing approach for 4-bit integer keys:
  • (A) There is a main hash table of size 4.
  • (B) The 2 least significant bits of a key is used to index into the main hash table.
  • (C) Initially, the main hash table entries are empty.
  • (D) Thereafter, when more keys are hashed into it, to resolve collisions, the set of all keys corresponding to a main hash table entry is organized as a binary tree that grows on demand.
  • (E) First, the 3rd least significant bit is used to divide the keys into left and right subtrees.
  • (F) To resolve more collisions, each node of the binary tree is further sub-divided into left and right subtrees based on the 4th least significant bit.
  • (G) A split is done only if it is needed, i.e., only when there is a collision.
Consider the following state of the hash table. Which of the following sequences of key insertions can cause the above state of the hash table (assume the keys are in decimal notation)?

(A)

5,9,4,13,10,7

(B)

9,5,10,6,7,1

(C)

10,9,6,7,5,13

(D)

9,5,13,6,10,14

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments