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.1
Unit 8 · Abstract data types · Topic 8.1

IB Computer Science HL — Fundamentals of ADTs

Fundamentals of ADTs

Higher Level students should use this topic hub as a map: start with the shared sub-topics, then follow the HL-only extensions and exam-skill links where this topic asks for deeper analysis.

Exam technique guidePractice questions

Key concepts in Fundamentals of ADTs

Key Idea: An abstract data type says what operations a structure offers and what they mean — never how it is built. That separation is the whole unit: it lets an implementation be replaced for a faster one without a single caller changing.

Paper 1

  • Define an ADT; state a property of a structure.
  • Give the result of a set operation or a traversal.

Paper 2

  • Construct or trace linked-list and tree operations.
  • Evaluate a choice against an alternative.

Both

  • Justify from the operation the program repeats most, with its complexity.

🗝️ ADT against data structure

Abstract data typeData structure
DescribesWhat you can do, and what it meansHow it is stored
ExamplesStack, queue, list, set, mapArray, linked list, hash table, tree
Chosen forThe behaviour neededThe performance that behaviour needs
Can be changedRarely — callers depend on itFreely — nobody outside can tell
A stack offers no way to reach the middle, so no code can reach the middle and break last-in-first-out. The thing it refuses to do is the thing it promises.

🔗 Linked lists

SinglyDoublyCircular
PointsForwards onlyBoth waysLast node → first
Memory per nodeOne referenceTwoOne
Traversal stops atNoneNoneThe head again
Deleting needsThe node beforeOnly the nodeThe node before

The operations

  • Traverse from the head until None — there is no other route in
  • Insert: point the new node forwards first, then repoint the previous one
  • Delete: route around it — prev.next ← target.next. Nothing is erased
  • The head is always the special case: it has no previous node
  • Reaching the nth element is O(n); inserting once in position is O(1)
Important: Writing prev.next ← new before new.next ← prev.next overwrites the only reference to the rest of the list. Every node after that point is orphaned, and nothing reports it.

🌲 Binary search trees

One rule and its consequences

  • For every node: left subtree smaller, right subtree larger — all descendants, not just children
  • Search discards an entire subtree per comparison
  • Insert is a search that ends at an empty child
  • In-order traversal — left, node, right — returns the values sorted, free
  • Cost is the height: about log₂ n balanced, but n if values arrive in sorted order
A BST is O(log n) while balanced. The same values inserted in ascending order give a single line — height n, and O(n). The shape depends entirely on insertion order.

🎯 Sets and hash tables

OperationMeaning{1,2,3} and {3,4}
Union ∪In either{1, 2, 3, 4}
Intersection ∩In both{3}
Difference −In the first, not the second{1, 2} — not symmetric

What a hash table does

  • The key computes its own address: hash it, take it modulo the table size, go there
  • A good hash function is deterministic, fast and uniform
  • Collisions are inevitable — more possible keys than buckets, which is arithmetic
  • Chaining keeps colliding keys in a list inside the bucket
  • O(1) on average, O(n) worst case — clustering is what destroys it

📝 Exam-style questions

IB-style questionEvaluate[6 marks]

A hospital system must find a patient by ID instantly, and must also print every patient in ID order each night. Evaluate a hash table against a binary search tree for this.

🔒 Model answer plan

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

Claim your free topic →
IB-style questionConstruct[5 marks]

Write a Python function that counts how many nodes a singly linked list holds, and state its complexity and why it cannot be improved without changing the structure.

🔒 Model answer plan

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

Claim your free topic →

✅ Quick check

Cover the answers.

ADT or data structure: a hash table? Data structure — one way to implement a map or a set. The map is the ADT.

Why must a new node be linked forwards first? Repointing the previous node first overwrites the only reference to the rest of the list, orphaning everything after it.

What does an in-order traversal of a BST return? Every value in ascending order, with no sorting step — the ordering is already in the structure.

Is a − b the same as b − a? No. Difference is the one set operation whose order matters.

Why is a hash table O(n) in the worst case? A hash function that clusters keys into few buckets makes one chain the whole table, so lookup becomes a linear search.


Exam tips

  • ADT = what it promises. Data structure = how it is built. Say which you mean.
  • Justify every choice by the operation the program repeats most, with its complexity.
  • Link a new node forwards BEFORE repointing the previous one.
  • Handle the head separately — it has no previous node, and examiners pick that case.
  • O(log n) while balanced · O(1) on average — never drop the qualification.
  • Evaluate needs both sides AND a verdict. The verdict is its own mark.

What you'll learn in Topic 8.1

  • 8.1.1 What ADTs are for
  • 8.1.2 Evaluating linked lists
  • 8.1.3 Building linked lists
  • 8.1.4 Binary search trees
  • 8.1.5 Sets
  • 8.1.6 Core principles of ADTs
Suggested study order: Read the notes for each sub-topic below → test yourself with flashcards → attempt practice questions → review exam technique.

Study resources — 8.1 Fundamentals of ADTs

8.1.1

What ADTs are for

Notes
8.1.2

Evaluating linked lists

Notes
8.1.3

Building linked lists

Notes
8.1.4

Binary search trees

Notes
8.1.5

Sets

Notes
8.1.6

Core principles of ADTs

Notes

Ready to study Fundamentals of ADTs?

Get expert practice questions with instant AI feedback, and a study planner tailored to your IB Computer Science HL exam date.

Start studying free

Topic 8.1 Fundamentals of ADTs forms a core part of Unit 8: Abstract data types in IB Computer Science HL. Mastering these concepts will strengthen your understanding of connected topics across the syllabus and prepare you for exam questions that require analysis, evaluation, and real-world application.

Previous topic
7.2 OOP: multiple classes
All Computer Science HL topics
Exam technique

Ready to practice?

Get AI-graded practice questions, mock exams, flashcards, and a personalised study plan — all aligned to your IB syllabus.

Start Studying Free

No credit card required · No time limit