1.Easy
In which order does a postorder traversal of a binary tree visit nodes?
- ALeft subtree, then node, then right subtree
- BLeft subtree, then right subtree, then node
- CNode, then left subtree, then right subtree
- DRight subtree, then node, then left subtree
2.Easy
Which data structure is most suitable for the "undo" feature in a text editor?
- AStack
- BHash set
- CQueue
- DGraph
3.Easy
Which data structure works on the principle "first in, first out"?
- AHeap
- BQueue
- CBinary tree
- DStack
4.Medium
A hash table of size 7 uses h(k) = k mod 7 and linear probing. After inserting 10, where is 17 stored?
- AIndex 6
- BIndex 4
- CIndex 0
- DIndex 3
5.Medium
In a hash table using open addressing, what is the maximum possible load factor?
- AThere is no maximum
- B0.5
- C2
- D1
6.Medium
What is the value of the postfix expression 3 4 + 2 * ?
- A10
- B14
- C24
- D11
7.Hard
In a hash table using open addressing, why is deletion often done with a "tombstone" marker?
- AIt makes the table sorted
- BDeleted keys must be kept forever for security, so slots can never be reused
- CEmptying the slot could break the probe sequence for other keys
- DTombstones speed up hashing
8.Hard
What is the main advantage of a skip list over a sorted linked list?
- AIt uses no extra memory
- BExpected O(log n) search by using several levels of forward pointers
- CIt stores keys without order
- DGuaranteed O(1) search because every node stores a pointer to every other node
Answer key
- 1. B · Left subtree, then right subtree, then node
- 2. A · Stack
- 3. B · Queue
- 4. B · Index 4
- 5. D · 1
- 6. B · 14
- 7. C · Emptying the slot could break the probe sequence for other keys
- 8. B · Expected O(log n) search by using several levels of forward pointers
Full step-by-step solutions: practise this topic on examproblems.com.