What is the disadvantage of BST over the hash table?
A. BST is easier to implement
B. BST can get the keys sorted by just performing inorder traversal
C. BST can perform range query easily
D. Time complexity of hash table in inserting, searching and deleting is less than that of BST
Answer: Option D
What is the primary purpose of hashing in data structures?
A. To provide constant time complexity for searches.
B. To sort elements in ascending order.
C. To balance binary search trees.
D. To implement priority queues.
In hashing, what is a "collision"?
A. When two elements are stored in the same slot.
B. When a hash table exceeds its capacity.
C. When a hash function fails to produce a unique index.
D. When two keys hash to the same index.
Which of the following is a common method to handle collisions in hashing?
A. Inorder traversal
B. Depth-first search
C. Linear probing
D. Binary search
What is a hash function primarily used for in hashing?
A. To balance a binary search tree.
B. To map data to a fixed-size value.
C. To find the maximum element in a set.
D. To balance a binary search tree.

Join The Discussion