Back to Topic 8.1 — Fundamentals of ADTs
8.1.4Computer Science HL5 flashcards

Binary search trees

Practice Flashcards

Flip to reveal answers
Card 1 of 58.1.4
8.1.4
Question

What is the binary search tree ordering rule?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Binary search trees

Sign up free to track progress and get spaced-repetition review schedules.

Card 1definition

Question

What is the binary search tree ordering rule?

Answer

For **every** node, all values in its left subtree are smaller and all in its right subtree are larger — every descendant, not just the children.

Card 2concept

Question

Why is a BST search fast?

Answer

Each comparison says which side the value must be on, so an **entire subtree** is discarded without being examined. About log₂ n comparisons when balanced.

Card 3process

Question

What does an in-order traversal give you?

Answer

Every value in **ascending order** — left subtree, node, right subtree — with no sorting step.

Card 4concept

Question

What does sorted input do to a BST?

Answer

Every value goes the same direction, so the tree **degenerates into a line**: height n, search O(n), exactly like a linked list.

Card 5process

Question

How is a node with two children deleted?

Answer

It is replaced by its **in-order successor** — the smallest value in its right subtree — which preserves the ordering rule.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free