Q: 1 Which data structure is typically used to implement hash table?
Linked List
Array
Binary Tree
Stack
[ Option B ]
A hash table is typically implemented using an array. The hash function converts a key into an array index, and the value is stored at that index in the array.
Arrays are used because they provide fast random access, which allows insertion, deletion, and searching operations in O(1) average time.
Q: 2 Which data structure is used for efficient searching, insertion, and deletion of elements?
Stack
Queue
Hash Table
More than one of the above
[ Option C ]
A Hash Table provides very fast searching, insertion, and deletion, generally in O(1) time on average, because it uses a hash function to compute the index of the element.
Hash Table stores data in an associative manner using a hash function to compute an index where the value is stored.
Q: 3 An advantage of chained hash table (external hashing) over the open addressing scheme is-
Worst case complexity of search operations is less
Space used is less
Deletion is easier
None of the above
[ Option C ]
In a chained hash table (external hashing), each slot in the hash table holds a linked list of all elements that hash to the same index. This makes deletion easier because elements can be removed from the linked list without affecting other entries in the main hash table array.
Unlike in open addressing, stores all elements directly in the array itself, which makes deletion more complex.
Another advantage of external hashing is it handles collisions efficiently, multiple elements can exist at the same slot without affecting other slots.
Q: 4 Let hash function H(K) = (K mod 10) is employed to store in-order, the five keys [40, 27, 19, 48, 7] into set of single digit memory addresses (0-9). If linear probing is used to collision resolution, the key K=7 will be stored at which of the following location?
7
0
8
1
[ Option D ]
Given:
Step-by-step Insertion with Linear Probing:
Insert 40:
Insert 27:
Insert 19:
Insert 48:
Insert 7:
Use linear probing (check next available slot)
Try address 8 → Already taken (by 48)
Try address 9 → Already taken (by 19)
Try address 0 → Already taken (by 40)
Try address 1 → Free
So, 7 is stored at address 1
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.