1.Easy
Where is the smallest element of a binary min-heap found?
- AIn the leftmost leaf
- BIn any leaf, which must be searched
- CAt the root
- DIn the last array position
2.Easy
What does a hash function do in a hash table?
- AEncrypts the values in the table
- BMaps a key to an index in the table
- CCounts how many keys are stored
- DSorts the keys in the table
3.Easy
In a tree, what is a leaf?
- AA node with exactly one child
- BA node with no parent
- CA node with no children
- DThe node with the largest value
4.Medium
A circular buffer (ring buffer) is commonly used to implement:
- AA hash function
- BA graph traversal
- CA fixed-size queue
- DA binary search tree
5.Medium
Which collision resolution method stores colliding keys in a list at the same bucket?
- ALinear probing
- BSeparate chaining
- CQuadratic probing
- DDouble hashing
6.Medium
How much memory does an adjacency list use for a graph with V vertices and E edges?
- AO(V × E)
- BO(E²)
- CO(V²)
- DO(V + E)
7.Hard
A segment tree is typically used to:
- AStore a graph's edges
- BImplement a stack
- CAnswer range queries (such as range sums) and updates in O(log n)
- DSort strings alphabetically by storing each prefix in a separate tree node
8.Hard
Why do databases often use B+ trees rather than plain B-trees for indexes?
- AB+ trees use binary internal nodes, which reduces the number of disk reads
- BB+ trees do not need to be balanced
- CB+ trees store data only in the root
- DAll records are in linked leaves, which makes range scans efficient
Answer key
- 1. C · At the root
- 2. B · Maps a key to an index in the table
- 3. C · A node with no children
- 4. C · A fixed-size queue
- 5. B · Separate chaining
- 6. D · O(V + E)
- 7. C · Answer range queries (such as range sums) and updates in O(log n)
- 8. D · All records are in linked leaves, which makes range scans efficient
Full step-by-step solutions: practise this topic on examproblems.com.