1.Easy
What is a deque (double-ended queue)?
- AA structure that allows insertion and removal at both ends
- BTwo separate queues sharing one array
- CA queue sorted by priority
- DA queue that only allows removal at the back
2.Easy
What does each node in a doubly linked list contain?
- AData and two pointers, one to the next node and one to the node after that
- BData, a pointer to the next node and a pointer to the previous node
- CData and a pointer to the next node only
- DTwo copies of the data and one pointer
3.Easy
What is the main difference between a static array and a dynamic array?
- AA static array allows slower index access
- BA dynamic array stores its elements in linked nodes so it can grow one at a time
- CA static array can only store numbers
- DA dynamic array can grow by moving to a larger block of memory
4.Medium
Why can a binary heap be stored in an array without any pointers?
- AArrays automatically keep the keys in sorted order, so no pointers are needed
- BHeaps never contain more than 100 elements
- CAll keys in a heap are equal
- DIt is a complete binary tree, so positions follow simple index formulas
5.Medium
In a hash table using open addressing, what is the maximum possible load factor?
- A0.5
- B2
- C1
- DThere is no maximum
6.Medium
A circular buffer (ring buffer) is commonly used to implement:
- AA hash function
- BA graph traversal
- CA fixed-size queue
- DA binary search tree
7.Hard
What are the time and extra space costs of reversing a singly linked list in place?
- AO(n) time and O(n) extra space
- BO(n) time and O(1) extra space
- CO(n log n) time and O(1) extra space
- DO(1) time and O(1) extra space
8.Hard
The union-find (disjoint set) structure with union by rank and path compression has an amortised cost per operation of:
- AO(log n) exactly
- BO(n²)
- CO(n)
- DO(α(n)), the inverse Ackermann function, which is practically constant
Answer key
- 1. A · A structure that allows insertion and removal at both ends
- 2. B · Data, a pointer to the next node and a pointer to the previous node
- 3. D · A dynamic array can grow by moving to a larger block of memory
- 4. D · It is a complete binary tree, so positions follow simple index formulas
- 5. C · 1
- 6. C · A fixed-size queue
- 7. B · O(n) time and O(1) extra space
- 8. D · O(α(n)), the inverse Ackermann function, which is practically constant
Full step-by-step solutions: practise this topic on examproblems.com.