1.Easy
What is the max-heap property?
- AEvery left child's key is greater than or equal to its right sibling's key
- BEvery parent's key is greater than or equal to its children's keys
- CThe keys are sorted from left to right
- DAll leaves contain the maximum key
2.Easy
What is the defining feature of a set as an abstract data type?
- AIt stores elements without duplicates
- BIt stores elements in sorted order
- CIt stores key-value pairs
- DIt allows access only at one end
3.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
4.Medium
A circular buffer (ring buffer) is commonly used to implement:
- AA binary search tree
- BA hash function
- CA fixed-size queue
- DA graph traversal
5.Medium
In a binary heap stored in an array starting at index 0, where is the parent of the node at index i?
- AAt index i − 1
- BAt index ⌊i / 2⌋ + 1
- CAt index 2i + 1
- DAt index ⌊(i − 1) / 2⌋
6.Medium
How many nodes does a perfect binary tree of height h have, with height counted in edges?
- A2h + 1
- Bh2
- C2h
- D2h+1 − 1
7.Hard
The keys 5, 3, 8, 1 are inserted in this order into an empty array-based binary min-heap. What is the final array?
- A[3, 1, 8, 5]
- B[1, 3, 8, 5]
- C[1, 5, 8, 3]
- D[1, 3, 5, 8]
8.Hard
In a circular buffer, front == rear can mean either empty or full. What is a common way to tell them apart?
- AKeep a separate element count, or always leave one slot unused
- BAlways clear the buffer whenever front equals rear, so the state is empty
- CMake the buffer size a power of two
- DStore the front and rear in the same variable
Answer key
- 1. B · Every parent's key is greater than or equal to its children's keys
- 2. A · It stores elements without duplicates
- 3. B · Maps a key to an index in the table
- 4. C · A fixed-size queue
- 5. D · At index ⌊(i − 1) / 2⌋
- 6. D · 2h+1 − 1
- 7. B · [1, 3, 8, 5]
- 8. A · Keep a separate element count, or always leave one slot unused
Full step-by-step solutions: practise this topic on examproblems.com.