1.Easy
What does each node in a doubly linked list contain?
- AData and a pointer to the next node only
- BData, a pointer to the next node and a pointer to the previous node
- CData and two pointers, one to the next node and one to the node after that
- DTwo copies of the data and one pointer
2.Easy
What is the defining feature of a set as an abstract data type?
- AIt stores key-value pairs
- BIt stores elements without duplicates
- CIt stores elements in sorted order
- DIt allows access only at one end
3.Easy
In a tree, what are sibling nodes?
- ANodes that share the same parent
- BNodes at the same depth in different subtrees
- CNodes that have no children
- DA node and its parent
4.Medium
What is true of the adjacency matrix of an undirected graph?
- AIts main diagonal always contains ones
- BIt is always upper triangular
- CEach row has exactly one 1
- DIt is symmetric about the main diagonal
5.Medium
In a binary min-heap stored in an array (index starting at 0), the children of the node at index i are at:
- Ai + 1 and i + 2
- B2i and 2i + 1
- Ci/2 and i/2 + 1
- D2i + 1 and 2i + 2
6.Medium
An in-order traversal of a binary search tree visits the keys in:
- AInsertion order
- BDescending order always
- CLevel order
- DAscending sorted order
7.Hard
A Fenwick tree (binary indexed tree) over an array of n numbers supports which operations in O(log n)?
- ASorting the array and binary search
- BPrefix-sum queries and single-element updates
- CFinding the median in O(1)
- DInserting elements at any position
8.Hard
How does a radix tree (compressed trie) improve on a plain trie?
- AIt stores each word in a hash table at the root instead of in separate nodes
- BIt merges chains of single-child nodes into one edge labelled with a string
- CIt sorts the children of each node by frequency
- DIt keeps only the first letter of each word
Answer key
- 1. B · Data, a pointer to the next node and a pointer to the previous node
- 2. B · It stores elements without duplicates
- 3. A · Nodes that share the same parent
- 4. D · It is symmetric about the main diagonal
- 5. D · 2i + 1 and 2i + 2
- 6. D · Ascending sorted order
- 7. B · Prefix-sum queries and single-element updates
- 8. B · It merges chains of single-child nodes into one edge labelled with a string
Full step-by-step solutions: practise this topic on examproblems.com.