1.Easy
What is the root of a tree?
- AThe node with the largest value
- BAny node in the middle
- CThe top node with no parent
- DA node with no children
2.Easy
In a tree, what are sibling nodes?
- ANodes at the same depth in different subtrees
- BNodes that share the same parent
- CA node and its parent
- DNodes that have no children
3.Easy
Where is the smallest element of a binary min-heap found?
- AAt the root
- BIn any leaf, which must be searched
- CIn the leftmost leaf
- DIn the last array position
4.Medium
A binary tree has root 1 with left child 2 and right child 3; node 2 has children 4 (left) and 5 (right). What is the preorder traversal?
- A4 5 2 3 1
- B1 2 3 4 5
- C4 2 5 1 3
- D1 2 4 5 3
5.Medium
What is the purpose of a sentinel (dummy) node in a linked list?
- ATo simplify code by removing special cases at the head or tail
- BTo store the number of elements
- CTo prevent the list from growing beyond a fixed maximum number of nodes
- DTo make the list sorted
6.Medium
Which data structure is used by depth-first search (iterative version)?
- AA stack
- BA queue
- CA hash table only
- DA heap
7.Hard
How does a radix tree (compressed trie) improve on a plain trie?
- AIt merges chains of single-child nodes into one edge labelled with a string
- BIt keeps only the first letter of each word
- CIt sorts the children of each node by frequency
- DIt stores each word in a hash table at the root instead of in separate nodes
8.Hard
How long does it take to search for an arbitrary key in a binary min-heap of n elements?
- AO(log n)
- BO(1)
- CO(log log n)
- DO(n)
Answer key
- 1. C · The top node with no parent
- 2. B · Nodes that share the same parent
- 3. A · At the root
- 4. D · 1 2 4 5 3
- 5. A · To simplify code by removing special cases at the head or tail
- 6. A · A stack
- 7. A · It merges chains of single-child nodes into one edge labelled with a string
- 8. D · O(n)
Full step-by-step solutions: practise this topic on examproblems.com.