GATE CS 2021 Set 1 — Question 57

Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.
MSQ+2 / -0HardStatic & Dynamic HashingIndexing & File OrganizationDatabasesChainingHashingProgramming & Data Structures

Databases → Hashing → Chaining

Last updated

Question

Consider a dynamic hashing approach for 4-bit integer keys:
1.There is a main hash table of size 4.
2.The 2 least significant bits of a key is used to index into the main hash table.
3.Initially, the main hash table entries are empty.
4.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.
5.First, the 3rd3^{rd} least significant bit is used to divide the keys into left and right subtrees.
6.To resolve more collisions, each node of the binary tree is further sub-divided into left and right subtrees based on the 4th4^{th} least significant bit.
7.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.
Diagram showing a hash table with indices 00, 01, 10, 11. Index 00 is empty. Index 01 points to a tree structure splitting on 0 and 1, with the 1 branch splitting again. Index 10 points to a tree splitting on 0 and 1. Index 11 points to a single node.

Which of the following sequences of key insertions can cause the above state of the hash table (assume the keys are in decimal notation)?
Your answer

Select all that apply, then check your answer.

The solution stays hidden until you check.

Continue learning with Success Tracker

A step still unclear? Work through it with support

Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.

AI-powered practice· Unlimited practice on eligible plans
PYQs with solutions
Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
Practice that adapts
Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
AI doubt support
Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.

Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.

This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.

More questions on Hashing