Recall & Review
beginner
What is a Binary Search Tree (BST)?
A BST is a tree where each node has at most two children. The left child's value is less than the parent's value, and the right child's value is greater. This helps in fast searching.
Click to reveal answer
beginner
How does the search operation work in a BST?
Start at the root. If the value equals the node's value, stop. If smaller, go left. If larger, go right. Repeat until found or no more nodes.
Click to reveal answer
beginner
Why is BST search faster than searching in a list?
BST search skips half of the tree at each step by choosing left or right child based on comparison, unlike a list which checks each item one by one.
Click to reveal answer
intermediate
What is the time complexity of searching in a balanced BST?
The time complexity is O(log n) because each step halves the search space in a balanced BST.
Click to reveal answer
beginner
What happens if the value is not found in the BST during search?
The search reaches a null child (no node), meaning the value is not in the tree.
Click to reveal answer
In a BST, if the search value is less than the current node's value, where do you go next?
✗ Incorrect
If the search value is less, you move to the left child because all left children have smaller values.
What is the best case time complexity of searching in a BST?
✗ Incorrect
Best case is O(1) when the root node itself contains the search value.
If a BST is not balanced, what can happen to the search time?
✗ Incorrect
If the BST is skewed (like a linked list), search time can degrade to O(n).
What is the first step in searching a value in a BST?
✗ Incorrect
Search always starts by comparing the value with the root node.
If the search value is greater than the current node's value, where do you move next?
✗ Incorrect
You move to the right child because all right children have greater values.
Explain the step-by-step process of searching a value in a BST.
Think about how you decide which child to visit next.
You got /5 concepts.
Describe why BST search is more efficient than searching in an unsorted list.
Focus on how BST structure helps reduce search steps.
You got /4 concepts.