How programming fundamentals, data structures, constructs, algorithms and file processing build on each other in Python and Java, which statements are HL only, and how programming links to the rest of the course.
From the subject guide: what you need to know and be able to do.
Writing and tracing programs: variables, data structures, loops, algorithms and files.
Each one has its own page once something is published for it.
Programming turns an algorithm into instructions that a computer can run. The course uses Python or Java, and the topic covers the building blocks shared by both: variables and data types, decisions and loops, subprograms, data structures, standard searching and sorting algorithms, and reading and writing files.
It is the most practical topic in the course. Its ideas are learned by writing, running, tracing and fixing code, and they are applied in every program built for the internal assessment. They also underpin the rest of theme B, since classes in object-oriented programming are made of the same variables, conditions and loops, and abstract data types are built from the same arrays and references.
The subtopics build on each other, though a sensible order of study differs a little from their numbering. Subtopic B2.1, Programming fundamentals, comes first: variables and constants, data types, scope, substrings, exception handling and debugging. Subtopic B2.3, Programming constructs, adds sequence, selection, loops and subprograms, which every later subtopic uses.

Subtopic B2.2, Data structures, holds collections of data: static and dynamic structures, arrays and lists in one and two dimensions, and the stack and queue. Subtopic B2.5, File processing, uses loops and exception handling to read, write and append text files, so that data outlives the program. Subtopic B2.4, Programming algorithms, works on arrays and lists: it measures efficiency with Big O notation and constructs and traces linear search, binary search, bubble sort and selection sort.
All five subtopics are studied at SL and HL, and only one of them contains HL-only statements. HL students study those extra statements inside the SL page on programming algorithms, where each has a heading marked "(HL only)" and opens with an HL box.
Subtopic | Level | HL-only statements inside it |
|---|---|---|
B2.1 Programming fundamentals | SL and HL | None |
B2.2 Data structures | SL and HL | None |
B2.3 Programming constructs | SL and HL | None |
B2.4 Programming algorithms | SL and HL | B2.4.4: the idea of recursion (base case, recursive case and the call stack) and its uses, such as quicksort and fractals. B2.4.5: constructing and tracing simple recursive algorithms that make one recursive call each time |
B2.5 File processing | SL and HL | None |
Every code listing in the course appears in both languages. Where Python and Java differ in a way that matters, such as Java's fixed-length arrays against Python's lists, Java's checked exceptions or Python's integers that never overflow, the subtopic pages explain the difference.
Programming connects to both themes. Trace tables and flowcharts come from topic B1, Computational thinking, and are used on code throughout. Data types rest on the binary storage of subtopic A1.2, which explains why a Java int overflows past 2,147,483,647. SQL in topic A3 is a contrast: a declarative language that states what result is wanted, where Python and Java state how to compute it.
Programming also leads directly into the HL topics of theme B. Methods in topic B3, Object-oriented programming, are subprograms attached to a class, and the stacks and queues of B2.2 are the first examples of the abstract data types of topic B4 (HL).
The official decks for this part of the syllabus.
With a free account, Augment remembers where you stopped and what you have practiced.