1.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
2.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
3.Easy
What is the name of the queue operation that removes the element at the front?
- APush
- BEnqueue
- CInsert
- DDequeue
4.Medium
What is the worst-case height of a binary search tree with n nodes if keys are inserted in sorted order?
- A√n
- Bn (it becomes a linked list)
- Clog₂ n
- D1
5.Medium
An adjacency matrix for a graph with V vertices uses how much memory?
- AO(E)
- BO(log V)
- CO(V + E)
- DO(V²)
6.Medium
How much memory does an adjacency list use for a graph with V vertices and E edges?
- AO(E²)
- BO(V²)
- CO(V × E)
- DO(V + E)
7.Hard
In a hash table using open addressing, why is deletion often done with a "tombstone" marker?
- ATombstones speed up hashing
- BEmptying the slot could break the probe sequence for other keys
- CIt makes the table sorted
- DDeleted keys must be kept forever for security, so slots can never be reused
8.Hard
In Kruskal's minimum spanning tree algorithm, what is the union-find structure used for?
- AChecking whether an edge's two endpoints are already connected
- BChoosing the starting vertex
- CStoring each vertex's current distance from the source during the search
- DSorting the edges by weight
Answer key
- 1. D · A dynamic array can grow by moving to a larger block of memory
- 2. A · A structure that allows insertion and removal at both ends
- 3. D · Dequeue
- 4. B · n (it becomes a linked list)
- 5. D · O(V²)
- 6. D · O(V + E)
- 7. B · Emptying the slot could break the probe sequence for other keys
- 8. A · Checking whether an edge's two endpoints are already connected
Full step-by-step solutions: practise this topic on examproblems.com.