Recall & Review
beginner
What is a Binary Search Tree (BST)?
A BST is a binary tree where each node's left child has a smaller value and the right child has a larger value than the node itself. This property helps in faster searching.
Click to reveal answer
beginner
How does a BST improve search efficiency compared to a plain binary tree?
BST uses the order property to decide which subtree to search, reducing the search space by half each step, leading to average search time of O(log n) instead of O(n) in plain binary trees.
Click to reveal answer
beginner
Why is a plain binary tree less efficient for search operations?
A plain binary tree has no order property, so to find a value, you may need to check every node, resulting in O(n) time complexity.
Click to reveal answer
beginner
What real-life analogy helps understand why BST is better than a plain binary tree for searching?
Like a phone book sorted by names (BST), you can quickly find a name by skipping half the book each time. A plain list (plain binary tree) requires checking every name one by one.
Click to reveal answer
intermediate
What is the worst-case time complexity of search in a BST and when does it happen?
The worst-case time is O(n), which happens when the BST becomes skewed (like a linked list) due to inserting sorted data without balancing.
Click to reveal answer
What property makes BST faster for searching than a plain binary tree?
✗ Incorrect
BST nodes are arranged so left child < parent < right child, enabling faster search.
What is the average time complexity of searching in a balanced BST?
✗ Incorrect
Balanced BST reduces search space by half each step, leading to O(log n) time.
In which case does BST search degrade to O(n)?
✗ Incorrect
A skewed BST behaves like a linked list, causing O(n) search time.
Which data structure is like a phone book for quick searching?
✗ Incorrect
BST is like a sorted phone book allowing quick search.
Why is a plain binary tree not efficient for searching?
✗ Incorrect
Without order, search must check every node, making it slow.
Explain why a Binary Search Tree is preferred over a plain binary tree for searching data.
Think about how sorting helps find things faster.
You got /4 concepts.
Describe a real-life example that helps understand the advantage of BST over a plain binary tree.
Imagine looking up a name in a phone book.
You got /4 concepts.