Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is the minimum value in the tree that looks like this: 10 ↘ 5 ↘ 20?
Look for the leftmost node.
True or False: The maximum value of a BST can be found at a left child.
Think about how the values are organized in the tree.
What is the primary method for finding the minimum value in a BST?
Think about which direction you travel for smaller values.
True or False: In a BST, the predecessor of a node will always be its left child.
Consider how to find the predecessor in the absence of a left child.
Given a BST with the following structure, find the predecessor and successor of the node with value 7.
5
/ \
3 8
/ \ \
1 4 9
\
6Show the path taken.
Think about moving up the tree and checking right/left children.
Write an algorithm to remove a node from a BST and then find the minimum and maximum values afterwards. Describe each step clearly.
Consider if the node has children and how that impacts the structure.
6 more questions in this section. Enroll free to practise them all.
Enroll free