1.Easy
Which data structure works on the principle "first in, first out"?
- ABinary tree
- BHeap
- CQueue
- DStack
2.Easy
What does a map (dictionary) store?
- AKey-value pairs with unique keys
- BValues sorted by size
- COnly values in insertion order
- DPairs of equal keys
3.Easy
In a singly linked list, what does the next pointer of the last node contain?
- ANull (no node)
- BThe address of the first node
- CThe address of the previous node
- DThe number of nodes in the list
4.Medium
Which data structure is used by depth-first search (iterative version)?
- AA stack
- BA heap
- CA queue
- DA hash table only
5.Medium
An adjacency matrix for a graph with V vertices uses how much memory?
- AO(log V)
- BO(V + E)
- CO(V²)
- DO(E)
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 2i + 1
- BAt index i − 1
- CAt index ⌊i / 2⌋ + 1
- DAt index ⌊(i − 1) / 2⌋
7.Hard
What is the main advantage of a skip list over a sorted linked list?
- AExpected O(log n) search by using several levels of forward pointers
- BGuaranteed O(1) search because every node stores a pointer to every other node
- CIt uses no extra memory
- DIt stores keys without order
8.Hard
Which structure lets you compute the maximum of every window of size k in an array in O(n) total?
- AA min-heap rebuilt for every window
- BA sorted array updated by shifting
- CA singly linked list of the window's elements
- DA deque holding indices in decreasing order of value
Answer key
- 1. C · Queue
- 2. A · Key-value pairs with unique keys
- 3. A · Null (no node)
- 4. A · A stack
- 5. C · O(V²)
- 6. D · At index ⌊(i − 1) / 2⌋
- 7. A · Expected O(log n) search by using several levels of forward pointers
- 8. D · A deque holding indices in decreasing order of value
Full step-by-step solutions: practise this topic on examproblems.com.