1.Easy
Which data structure works on the principle "first in, first out"?
- AQueue
- BHeap
- CStack
- DBinary tree
2.Easy
What is the name of the stack operation that adds an element to the top?
- APop
- BPush
- CEnqueue
- DPeek
3.Easy
In an undirected graph, what is the degree of a vertex?
- AThe number of vertices in the graph
- BThe length of the longest path from it
- CThe number of edges connected to it
- DIts position in the adjacency list
4.Medium
Why can a binary heap be stored in an array without any pointers?
- AAll keys in a heap are equal
- BHeaps never contain more than 100 elements
- CArrays automatically keep the keys in sorted order, so no pointers are needed
- 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
- B1
- C2
- DThere is no maximum
6.Medium
Which collision resolution method stores colliding keys in a list at the same bucket?
- ADouble hashing
- BQuadratic probing
- CSeparate chaining
- DLinear probing
7.Hard
An AVL node is unbalanced because its left child's right subtree became too tall (left-right case). Which fix is applied?
- AA right rotation at the left child, then a left rotation at the node
- BA left rotation at the left child, then a right rotation at the node
- CA single left rotation at the node
- DA single right rotation at the node
8.Hard
Which data structure supports an LRU (least recently used) cache with O(1) get and put?
- AA binary search tree only
- BA hash map combined with a doubly linked list
- CA stack only
- DA single sorted array
Answer key
- 1. A · Queue
- 2. B · Push
- 3. C · The number of edges connected to it
- 4. D · It is a complete binary tree, so positions follow simple index formulas
- 5. B · 1
- 6. C · Separate chaining
- 7. B · A left rotation at the left child, then a right rotation at the node
- 8. B · A hash map combined with a doubly linked list
Full step-by-step solutions: practise this topic on examproblems.com.