1.Easy
Where is the smallest element of a binary min-heap found?
- AAt the root
- BIn the leftmost leaf
- CIn any leaf, which must be searched
- DIn the last array position
2.Easy
What is the load factor of a hash table?
- AThe number of stored elements divided by the number of buckets
- BThe number of collisions so far
- CThe number of buckets divided by the average length of the keys stored
- DThe time needed to load the table from disk
3.Easy
In a tree, what are sibling nodes?
- ANodes that have no children
- BNodes that share the same parent
- CNodes at the same depth in different subtrees
- DA node and its parent
4.Medium
Which collision resolution method stores colliding keys in a list at the same bucket?
- ASeparate chaining
- BDouble hashing
- CLinear probing
- DQuadratic probing
5.Medium
In a binary min-heap stored in an array (index starting at 0), the children of the node at index i are at:
- Ai/2 and i/2 + 1
- Bi + 1 and i + 2
- C2i + 1 and 2i + 2
- D2i and 2i + 1
6.Medium
What is the worst-case height of a binary search tree with n nodes if keys are inserted in sorted order?
- An (it becomes a linked list)
- B1
- C√n
- Dlog₂ n
7.Hard
In a hash table using open addressing, why is deletion often done with a "tombstone" marker?
- ADeleted keys must be kept forever for security, so slots can never be reused
- BTombstones speed up hashing
- CIt makes the table sorted
- DEmptying the slot could break the probe sequence for other keys
8.Hard
You must keep the k smallest values from a stream of n numbers using O(k) memory. Which approach works in O(n log k) time?
- AA FIFO queue of the last k values
- BA sorted array of all n values
- CA max-heap of size k, replacing its root when a smaller value arrives
- DA min-heap holding all n values, from which the k smallest are popped at the end
Answer key
- 1. A · At the root
- 2. A · The number of stored elements divided by the number of buckets
- 3. B · Nodes that share the same parent
- 4. A · Separate chaining
- 5. C · 2i + 1 and 2i + 2
- 6. A · n (it becomes a linked list)
- 7. D · Emptying the slot could break the probe sequence for other keys
- 8. C · A max-heap of size k, replacing its root when a smaller value arrives
Full step-by-step solutions: practise this topic on examproblems.com.