The depth of a node in a tree is:
- AThe number of edges from that node to the deepest leaf
- BThe number of edges from the root to that node
- CThe number of nodes in its subtree
- DThe number of children of that node
The depth of a node in a tree is:
What is the defining feature of a set as an abstract data type?
In a singly linked list, what does the next pointer of the last node contain?
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?
An application needs fast lookups and also needs to list keys in sorted order and answer range queries. Which structure fits best?
How many nodes does a perfect binary tree of height h have, with height counted in edges?
In the BST with root 50, left subtree 30 (children 20, 40) and right subtree 70 (children 60, 80), the root is deleted using the in-order successor. Which key becomes the new root?
You must keep the k smallest values from a stream of n numbers using O(k) memory. Which approach works in O(n log k) time?
Full step-by-step solutions: practise this topic on examproblems.com.