0
0
DSA Goprogramming~5 mins

BST Property and Why It Matters in DSA Go - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the BST property?
In a Binary Search Tree (BST), for every node, all values in its left subtree are smaller, and all values in its right subtree are larger.
Click to reveal answer
beginner
Why does the BST property matter?
It allows fast searching, inserting, and deleting because we can decide to go left or right at each node, reducing the work to about log₂(n) steps.
Click to reveal answer
intermediate
What happens if the BST property is broken?
The tree loses its order, making search and other operations slower, often requiring checking many nodes instead of just a few.
Click to reveal answer
beginner
How does the BST property help in searching for a value?
At each node, compare the value to search with the node's value. If smaller, go left; if larger, go right. This halves the search space each step.
Click to reveal answer
intermediate
Can a BST have duplicate values? Why or why not?
Usually no, because duplicates break the strict ordering needed for the BST property. Some variations allow duplicates but handle them carefully (e.g., always to the right).
Click to reveal answer
What must be true for every node in a BST?
ALeft subtree values < node < right subtree values
BLeft subtree values > node > right subtree values
CAll subtree values are equal to node
DNo specific order is required
Why is searching faster in a BST compared to a regular binary tree?
ABecause BST property lets us ignore half the tree at each step
BBecause BST is always balanced
CBecause BST stores values in arrays
DBecause BST uses hashing
What happens if you insert a value smaller than the root in a BST?
AIt goes to the right subtree
BIt goes to the left subtree
CIt replaces the root
DIt is ignored
If a BST property is broken, what is the likely effect?
ATree becomes balanced
BSearch becomes faster
CSearch becomes slower
DTree becomes empty
Which of these is NOT a reason the BST property is useful?
AFaster search
BFaster insert
CFaster delete
DAllows duplicate values anywhere
Explain the BST property and how it helps in searching for a value.
Think about how you decide to go left or right when searching.
You got /4 concepts.
    Describe what happens if the BST property is broken and why it matters.
    Consider how the tree behaves without the ordering rule.
    You got /4 concepts.