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 6.2Arrays and lists
Back to Computer Science HL Topics
6.2.26 min read

Arrays and lists (Computer Science HL)

IB Computer Science • Unit 6

Exam preparation

Practice the questions examiners actually ask

Our question bank mirrors real IB exam papers. Practice under timed conditions and track your progress across topics.

Start Practicing

Contents

  • Many values under one name
  • Adding, removing, going through
  • Two dimensions
  • Exam-style question
The big idea: One variable holds one value. A list holds many, each reachable by its position.

That is what lets a loop handle a thousand items with the same three lines it uses for three.
Positions start at 0 here too: A list of four items has positions 0, 1, 2 and 3.

Asking for marks[4] is an error — and "off by one at the end" is the single commonest list bug.

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

Adding

  • append — at the end, the cheapest place
  • insert(position, value) — anywhere, but everything after shifts along
  • Java's ArrayList uses add

Removing

  • remove(value) — the first matching item
  • pop() — the last item, and gives it back to you
  • pop(position) — a chosen position
  • Everything after a removal shifts down

Traversing

  • for item in list — when you only need the values
  • an index loop over the positions — when you need the position, not just the value
  • Never change a list's length while looping over it
Do not remove while you loop: Removing an item shifts everything after it down one place, while the loop's counter still moves up.

The result is that items get skipped, silently. Build a new list instead, or loop over a copy.

Stop wasting time on topics you know

Our AI identifies your weak areas and focuses your study time where it matters. No more overstudying easy topics.

Try Smart Study FreeYour first topic is free to keep • No credit card required
A list of lists: A 2D list is a list whose items are themselves lists — a grid, with a row number and a column number.

Always in that order: [row][column].
1

Row first, always

2

A nested loop visits every cell

3

Rows and columns are not symmetric

How this is tested — you must get positions right and pick the correct traversal for the job. It comes up two ways:

Paper 2 — working with code

  • Construct code using a 1D or 2D list, 4-6 marks
  • Trace a loop over a list and state the output
  • Add, remove or search within a list

Paper 2 — the algorithmic-thinking question

  • Reason about a grid with no code shown
  • Explain why a traversal visits what it does
The classic trap: Removing items while looping over the list. Everything after the removal shifts down while the counter moves up, so items are skipped silently. Build a new list instead.
IB-style questionConstruct[6 marks]

A 2D list holds four students' marks in three subjects, one row per student. Write code to print each student's total and to find the highest single mark.

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 Arrays and lists. Write your answer and get instant AI feedback — just like a real IB examiner.

two operations commonly performed on an array. [1 mark]

Related Computer Science HL Topics

Continue learning with these related topics from the same unit:

6.1.1Variables and data types
6.1.2Substrings
6.1.3Exception handling
6.1.4Debugging
View all Computer Science HL topics

Improve your exam technique

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

Previous
6.2.1Static vs dynamic structures
Next
Stacks (LIFO)6.2.3

30 exam-style questions ready for you

Students who practice on Aimnova improve their scores by 15% on average. Get instant feedback that shows exactly how to improve your answers.

Practice Now — FreeView All Computer Science HL Topics