Recall & Review
beginner
What does BST stand for in data structures?
BST stands for Binary Search Tree, a tree data structure where each node has at most two children, and the left child's value is less than the parent, while the right child's value is greater.
Click to reveal answer
beginner
How does the BST property help in searching for a value?
Because the left subtree contains smaller values and the right subtree contains larger values, you can decide to go left or right at each node, reducing the search area quickly.
Click to reveal answer
beginner
Why is searching in a BST more efficient than in a linked list?
In a BST, you skip half of the remaining nodes at each step by choosing left or right, while in a linked list you must check nodes one by one.
Click to reveal answer
intermediate
What is the average time complexity of searching in a balanced BST?
The average time complexity is O(log n), meaning the search time grows slowly as the number of nodes increases.
Click to reveal answer
intermediate
What happens to search efficiency if a BST becomes unbalanced?
If the BST becomes unbalanced (like a linked list), search efficiency drops to O(n), meaning you might have to check many nodes one by one.
Click to reveal answer
What property of a BST allows efficient searching?
✗ Incorrect
The BST property that left children are smaller and right children are larger allows quick decisions to go left or right during search.
What is the average time complexity of searching in a balanced BST?
✗ Incorrect
Balanced BSTs allow searching in O(log n) time because each step halves the search space.
If a BST is unbalanced and looks like a linked list, what is the search time complexity?
✗ Incorrect
An unbalanced BST can degrade to O(n) search time, similar to a linked list.
Why is searching in a linked list less efficient than in a BST?
✗ Incorrect
Linked lists require sequential checking of nodes, making search slower than BST's divide-and-conquer approach.
What does each step in searching a BST do?
✗ Incorrect
Each step compares the target value with the current node and decides to go left or right, narrowing the search.
Explain how the structure of a BST helps make searching faster compared to a simple list.
Think about how you decide which way to go at each node.
You got /3 concepts.
Describe what happens to search efficiency if a BST becomes unbalanced and why.
Consider what happens if all nodes are on one side.
You got /3 concepts.