aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer Science HLTopic 8.1Binary search trees
Back to Computer Science HL Topics
8.1.44 min read

Binary search trees (Computer Science HL)

IB Computer Science • Unit 8

Your first topic is free to keep

Know exactly what to write for full marks

Practice with exam questions and get AI feedback that shows you the perfect answer — what examiners want to see.

Start Free

Contents

  • One rule, applied everywhere
  • The vocabulary
  • Searching, inserting, traversing
  • Exam-style question
The big idea: In a binary search tree, for every node: everything in its left subtree is smaller, everything in its right subtree is larger.

Not just the two children — every descendant. That is what makes searching work.

Step through: the ordering rule, a search discarding half the tree at each step, an insert, and what sorted input does to it.

Interactive diagram

Explore the labelled diagram, charts and maps for this topic in full study mode.

Claim your free topic

Free preview

This is the free notes preview

You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:

  • FlashcardsLock in vocabulary and key terms with spaced repetition.
  • Practice questionsAnswer exam-style questions and get instant AI marking.
  • Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
  • Personalised study planA daily plan built around your exam date and weak areas.
Start Studying Free Full access to Aimnova Pro · cancel anytime
TermMeaning
RootThe single node at the top; every path starts here
Parent / childA node and the nodes directly below it — at most two
LeafA node with no children
SubtreeAny node together with everything below it
HeightThe longest path from root to leaf — what decides the cost
Height is the whole story: Every operation costs at most the height of the tree, because each step goes down one level and never back up.

A balanced tree of n nodes has height about log₂ n. That is the entire reason a BST is fast.

See how examiners mark answers

Access past paper questions with model answers. Learn exactly what earns marks and what doesn't.

Try Exam Vault FreeYour first topic is free to keep • No credit card required
1

Search

2

Insert

3

Delete

4

In-order traversal

In-order gives you sorted data free: Because everything left is smaller and everything right is larger, visiting left → node → right produces the values in ascending order with no sorting step at all.

That is often the reason a BST is chosen over a hash table, which has no order whatsoever.

How this is tested — you must apply the ordering rule to search or insert, and explain why the shape of the tree decides the cost. It comes up two ways:

Paper 2 — working with code

  • Explain the properties of a BST, 3-4 marks
  • Sketch the tree after a list of insertions
  • State the result of an in-order traversal

Paper 2 — the algorithmic-thinking question

  • Explain why sorted input degrades a BST
  • Compare a BST with another structure
The classic trap: Claiming a BST is O(log n) without qualification. It is O(log n) only while balanced — the same values inserted in sorted order give O(n). Say which you mean.
IB-style questionExplain[5 marks]

The values 20, 30, 40, 50, 60 are inserted into an empty BST in that order. Explain the shape that results, the cost of searching it, and how a different insertion order would help.

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Binary search trees. Write your answer and get instant AI feedback — just like a real IB examiner.

Names are inserted into a binary search tree in the order Marta, Ines, Rafal, Hana, Lucia. the resulting tree, then it again after Kai and Nadia are inserted. [2 marks]

Related Computer Science HL Topics

Continue learning with these related topics from the same unit:

8.1.1What ADTs are for
8.1.2Evaluating linked lists
8.1.3Building linked lists
8.1.5Sets
View all Computer Science HL topics

Improve your exam technique

Command terms, paper structure, and mark-scheme tips for Computer Science HL

Previous
8.1.3Building linked lists
Next
Sets8.1.5

1 practice questions on Binary search trees

Students who practiced this topic on Aimnova scored 82% on average. Try free practice questions and get instant AI feedback.

Try 1 Free QuestionsView All Computer Science HL Topics