Level 1: Bronze
A memorized definition. Not wrong, but it stops there.
A tree where the left is smaller and the right is larger.
2 stars Asked often.
In one or two sentences
A binary search tree searches by the rule that left is smaller and right is larger. A balanced tree keeps its height logarithmic to protect worst case performance.
Say it out loud, or type it below. What you type never leaves this device.
A memorized definition. Not wrong, but it stops there.
A tree where the left is smaller and the right is larger.
Correct, but too broad or missing context.
A binary search tree compares and goes down one side, so a search is O(log n) on average. If you insert sorted values in order it leans to one side and becomes O(n).
Reaches principle, use and trade-off, with words that invite the next question.
Height decides performance, so you need variants that stay balanced. AVL and red black trees rotate on insert and delete to keep the height logarithmic. Database indexes use B-trees, which hold many keys per node to cut disk reads. An in order traversal yields sorted order, an advantage over hashing. You pay to maintain balance and get a guaranteed worst case.
These are likely next questions from an interviewer. Think of your answer first, then press the button.
1 / 3
What happens if a binary search tree leans to one side?
Its height approaches n and search and insert become O(n), like a linked list.
2 / 3
Why do database indexes use B-trees, not binary trees?
A disk reads a large block at once, so packing many keys in a node lowers the height and cuts the number of reads.
3 / 3
What tree traversals exist?
Pre order, in order and post order are depth first. Level order is breadth first. In order on a binary search tree gives sorted order.
This is a textbook level concept, so no outside source is listed.