1.Easy
Which structure is typically used to implement a priority queue?
- AA string
- BA heap
- CA stack
- DA singly linked list without order
2.Easy
In a tree, what are sibling nodes?
- AA node and its parent
- BNodes that have no children
- CNodes at the same depth in different subtrees
- DNodes that share the same parent
3.Easy
What is the name of the stack operation that adds an element to the top?
- APeek
- BPush
- CEnqueue
- DPop
4.Medium
A trie (prefix tree) is especially efficient for:
- APrefix searches such as autocomplete
- BFinding shortest paths
- CStoring matrices
- DSorting numbers
5.Medium
How much memory does an adjacency list use for a graph with V vertices and E edges?
- AO(E²)
- BO(V × E)
- CO(V + E)
- DO(V²)
6.Medium
How long does a search for a word of length L take in a trie with a fixed alphabet?
- AO(log n), where n is the number of words
- BO(L), independent of how many words are stored
- CO(L × n)
- DO(n), where n is the number of words
7.Hard
Why do databases often use B+ trees rather than plain B-trees for indexes?
- AB+ trees do not need to be balanced
- BAll records are in linked leaves, which makes range scans efficient
- CB+ trees use binary internal nodes, which reduces the number of disk reads
- DB+ trees store data only in the root
8.Hard
The time complexity of decrease-key in a binary heap (given the element's position) is:
- AO(log n)
- BO(1)
- CO(n log n)
- DO(n)
Answer key
- 1. B · A heap
- 2. D · Nodes that share the same parent
- 3. B · Push
- 4. A · Prefix searches such as autocomplete
- 5. C · O(V + E)
- 6. B · O(L), independent of how many words are stored
- 7. B · All records are in linked leaves, which makes range scans efficient
- 8. A · O(log n)
Full step-by-step solutions: practise this topic on examproblems.com.