1.Easy
Where is the smallest element of a binary min-heap found?
- AIn the leftmost leaf
- BIn the last array position
- CIn any leaf, which must be searched
- DAt the root
2.Easy
Which data structure works on the principle "last in, first out"?
- ALinked list
- BQueue
- CStack
- DHash table
3.Easy
The depth of a node in a tree is:
- AThe number of edges from the root to that node
- BThe number of edges from that node to the deepest leaf
- CThe number of children of that node
- DThe number of nodes in its subtree
4.Medium
Why is traversing an array often much faster in practice than traversing a linked list of the same length?
- AArray traversal is O(1) in total, while linked list traversal is O(n)
- BArray elements are contiguous, so they make good use of the CPU cache
- CLinked lists always store elements on disk
- DArrays use fewer instructions to compare values
5.Medium
An adjacency matrix for a graph with V vertices uses how much memory?
- AO(V + E)
- BO(V²)
- CO(E)
- DO(log V)
6.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 − 1) / 2⌋
- CAt index ⌊i / 2⌋ + 1
- DAt index 2i + 1
7.Hard
How does a radix tree (compressed trie) improve on a plain trie?
- AIt sorts the children of each node by frequency
- BIt stores each word in a hash table at the root instead of in separate nodes
- CIt merges chains of single-child nodes into one edge labelled with a string
- DIt keeps only the first letter of each word
8.Hard
Which problem of linear probing does double hashing mainly reduce?
- AThe need for a hash function
- BThe O(n) cost of reading a key's value
- CThe need to store keys in the table
- DPrimary clustering, where long runs of occupied slots form
Answer key
- 1. D · At the root
- 2. C · Stack
- 3. A · The number of edges from the root to that node
- 4. B · Array elements are contiguous, so they make good use of the CPU cache
- 5. B · O(V²)
- 6. B · At index ⌊(i − 1) / 2⌋
- 7. C · It merges chains of single-child nodes into one edge labelled with a string
- 8. D · Primary clustering, where long runs of occupied slots form
Full step-by-step solutions: practise this topic on examproblems.com.