1.Easy
Which data structure works on the principle "first in, first out"?
- AHeap
- BBinary tree
- CQueue
- DStack
2.Easy
In a tree, what are sibling nodes?
- AA node and its parent
- BNodes that have no children
- CNodes that share the same parent
- DNodes at the same depth in different subtrees
3.Easy
In a hash table, what is a collision?
- ATwo equal keys are stored twice
- BTwo different keys map to the same index
- CA key cannot be hashed at all
- DThe table runs out of memory
4.Medium
What is the purpose of a sentinel (dummy) node in a linked list?
- ATo make the list sorted
- BTo store the number of elements
- CTo simplify code by removing special cases at the head or tail
- DTo prevent the list from growing beyond a fixed maximum number of nodes
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
The keys 50, 30, 70, 20, 40 are inserted in this order into an empty binary search tree. What is the left child of 30?
- A20
- B50
- C70
- D40
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 right rotation at the node
- DA single left rotation at the node
8.Hard
Which property keeps every B-tree perfectly balanced?
- AEach node stores one key
- BEvery node has exactly two children
- CThe keys are stored only in the root
- DAll leaves are at the same depth
Answer key
- 1. C · Queue
- 2. C · Nodes that share the same parent
- 3. B · Two different keys map to the same index
- 4. C · To simplify code by removing special cases at the head or tail
- 5. C · 1
- 6. A · 20
- 7. B · A left rotation at the left child, then a right rotation at the node
- 8. D · All leaves are at the same depth
Full step-by-step solutions: practise this topic on examproblems.com.