0
0
DSA C++programming~5 mins

Why BST Over Plain Binary Tree in DSA C++ - Quick Recap

Choose your learning style9 modes available
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?
ANodes are arranged in sorted order
BNodes have more children
CNodes store extra data
DNodes are connected randomly
What is the average time complexity of searching in a balanced BST?
AO(n)
BO(n log n)
CO(log n)
DO(1)
In which case does BST search degrade to O(n)?
AWhen tree has duplicate values
BWhen tree is empty
CWhen tree is balanced
DWhen tree is skewed
Which data structure is like a phone book for quick searching?
APlain binary tree
BBinary Search Tree
CLinked list
DStack
Why is a plain binary tree not efficient for searching?
AIt has no order property
BIt has too many nodes
CIt uses too much memory
DIt is always balanced
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.