1.Easy
In a singly linked list, what does the next pointer of the last node contain?
- AThe address of the previous node
- BThe number of nodes in the list
- CNull (no node)
- DThe address of the first node
2.Easy
The depth of a node in a tree is:
- AThe number of nodes in its subtree
- BThe number of edges from the root to that node
- CThe number of edges from that node to the deepest leaf
- DThe number of children of that node
3.Easy
What is the main difference between a static array and a dynamic array?
- AA dynamic array stores its elements in linked nodes so it can grow one at a time
- BA dynamic array can grow by moving to a larger block of memory
- CA static array allows slower index access
- DA static array can only store numbers
4.Medium
A trie (prefix tree) is especially efficient for:
- AFinding shortest paths
- BStoring matrices
- CPrefix searches such as autocomplete
- DSorting numbers
5.Medium
What is the time complexity of searching for a key in a balanced binary search tree?
- AO(log n)
- BO(n)
- CO(n log n)
- DO(1)
6.Medium
An adjacency matrix for a graph with V vertices uses how much memory?
- AO(V + E)
- BO(log V)
- CO(V²)
- DO(E)
7.Hard
The union-find (disjoint set) structure with union by rank and path compression has an amortised cost per operation of:
- AO(α(n)), the inverse Ackermann function, which is practically constant
- BO(log n) exactly
- CO(n²)
- DO(n)
8.Hard
A Bloom filter can answer "is this element in the set?" with:
- APossible false negatives but no false positives
- BAnswers only for numbers
- CPossible false positives but no false negatives
- DExact answers always
Answer key
- 1. C · Null (no node)
- 2. B · The number of edges from the root to that node
- 3. B · A dynamic array can grow by moving to a larger block of memory
- 4. C · Prefix searches such as autocomplete
- 5. A · O(log n)
- 6. C · O(V²)
- 7. A · O(α(n)), the inverse Ackermann function, which is practically constant
- 8. C · Possible false positives but no false negatives
Full step-by-step solutions: practise this topic on examproblems.com.