Recall & Review
beginner
What is the Binary Search Tree (BST) property?
In a BST, for every node, all values in its left subtree are smaller, and all values in its right subtree are larger than the node's value.
Click to reveal answer
beginner
Why does the BST property matter for searching?
Because the BST property keeps values ordered, it allows searching for a value by comparing and moving left or right, making search faster than checking every node.
Click to reveal answer
beginner
How does the BST property help with insertion?
Insertion uses the BST property to find the correct spot by comparing values and moving left or right until an empty spot is found, keeping the tree ordered.
Click to reveal answer
intermediate
What happens if the BST property is not maintained?
If the BST property breaks, searching and insertion become inefficient because the tree loses its order, possibly becoming like a linked list with slow operations.
Click to reveal answer
beginner
Explain the BST property using a real-life example.
Think of a phone book sorted by names: all names before 'John' come before it alphabetically (left), and all after come after (right). This order helps find a name quickly, like the BST property does for numbers.
Click to reveal answer
What must be true about the left subtree of a BST node?
✗ Incorrect
By definition, the left subtree contains only values smaller than the node's value.
Why is the BST property important for efficient searching?
✗ Incorrect
The BST property lets us decide to go left or right, skipping unnecessary parts and speeding up search.
If a BST property is broken, what is a likely consequence?
✗ Incorrect
Without the BST property, the tree loses order, making search slower, often like a linked list.
In a BST, where do values larger than a node go?
✗ Incorrect
Values larger than the node must be placed in the right subtree to maintain the BST property.
Which real-life example best illustrates the BST property?
✗ Incorrect
A sorted phone book orders names so you can quickly find one, similar to how BST orders values.
Describe the BST property and explain why it is important for searching and insertion.
Think about how ordering helps find or add values quickly.
You got /4 concepts.
What problems arise if the BST property is not maintained? Give an example.
Consider what happens if values are not in the right place.
You got /4 concepts.