0
0
DSA Javascriptprogramming~5 mins

Why BST Over Plain Binary Tree in DSA Javascript - Quick Recap

Choose your learning style9 modes available
Recall & Review
beginner
What is a Binary Search Tree (BST)?
A BST is a special type of binary tree where each node's left child has a smaller value, and the right child has a larger value than the node itself.
Click to reveal answer
beginner
Why is searching faster in a BST compared to a plain binary tree?
Because BST keeps nodes in order, it allows skipping half of the tree at each step, making search faster than checking every node in a plain binary tree.
Click to reveal answer
intermediate
What is the average time complexity of search in a BST?
The average time complexity is O(log n), where n is the number of nodes, because the tree is divided roughly in half at each step.
Click to reveal answer
beginner
What is a major drawback of a plain binary tree for searching?
A plain binary tree has no order, so searching may require checking every node, resulting in O(n) time complexity.
Click to reveal answer
intermediate
How does the structure of a BST help with insertion and deletion?
BST structure keeps data ordered, so insertion and deletion can be done efficiently by following the tree's order rules, usually in O(log n) time.
Click to reveal answer
What property distinguishes a BST from a plain binary tree?
AAll nodes have the same value
BEach node has exactly two children
CLeft child is smaller, right child is larger
DNodes are arranged randomly
What is the worst-case time complexity for searching in a plain binary tree?
AO(log n)
BO(n)
CO(1)
DO(n log n)
Why is searching in a BST usually faster than in a plain binary tree?
ABecause BSTs are balanced by default
BBecause BSTs use hashing
CBecause BSTs have fewer nodes
DBecause BSTs store data in order allowing skipping half the nodes
Which operation benefits from the BST property?
AAll of the above
BInsertion
CSearching
DDeletion
What happens if a BST becomes unbalanced?
ASearch time degrades to O(n)
BSearch time improves
CInsertion becomes impossible
DTree becomes a plain binary tree
Explain why a Binary Search Tree is preferred over a plain binary tree for searching data.
Think about how order helps find data faster.
You got /4 concepts.
    Describe how the structure of a BST affects insertion and deletion operations compared to a plain binary tree.
    Consider how order guides where to add or remove nodes.
    You got /4 concepts.