1.Easy
In a tree, what are sibling nodes?
- ANodes that share the same parent
- BA node and its parent
- CNodes at the same depth in different subtrees
- DNodes that have no children
2.Easy
In a hash table, what is a collision?
- AThe table runs out of memory
- BTwo equal keys are stored twice
- CA key cannot be hashed at all
- DTwo different keys map to the same index
3.Easy
In a tree, what is a leaf?
- AA node with no parent
- BA node with exactly one child
- CThe node with the largest value
- DA node with no children
4.Medium
A road network has 100,000 junctions, each connected to about 4 others. Which representation is most suitable?
- AAdjacency matrix
- BAdjacency list
- CA binary heap of edges
- DA single sorted array of vertices
5.Medium
What is the value of the postfix expression 3 4 + 2 * ?
- A10
- B14
- C24
- D11
6.Medium
What is true of the adjacency matrix of an undirected graph?
- AEach row has exactly one 1
- BIt is symmetric about the main diagonal
- CIt is always upper triangular
- DIts main diagonal always contains ones
7.Hard
Which pair of traversals always determines a unique binary tree with distinct keys?
- APreorder alone
- BLevel-order alone
- CPreorder and postorder
- DPreorder and inorder
8.Hard
A dynamic array doubles when full. Why do many implementations shrink it only when it is one quarter full, not half full?
- ABecause the memory allocator can only release memory in quarters of a block
- BBecause halving at one half would lose elements
- CTo keep the array sorted
- DTo avoid repeated resizing when pushes and pops alternate near the boundary
Answer key
- 1. A · Nodes that share the same parent
- 2. D · Two different keys map to the same index
- 3. D · A node with no children
- 4. B · Adjacency list
- 5. B · 14
- 6. B · It is symmetric about the main diagonal
- 7. D · Preorder and inorder
- 8. D · To avoid repeated resizing when pushes and pops alternate near the boundary
Full step-by-step solutions: practise this topic on examproblems.com.