aımnova
DashboardMy LearningCrash CoursesStudy 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
  • Crash Courses
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Teachers
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aımnova

IB study, practice and feedback built around the real exam.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.c1e448f

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

NotesComputer ScienceTopic 6.2Static vs dynamic structures
Back to Computer Science Topics
6.2.14 min read

Static vs dynamic structures

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

  1. 1Decided in advance, or as you go
  2. 2What fixed size buys and costs
  3. 3Choosing between them
  4. 4Exam-style question
The big idea: A static structure has its size fixed when it is created, and that memory is set aside in one block.

A dynamic structure grows and shrinks while the program runs, taking more memory when it needs it.
The names you will meet: A plain array is static: 30 places, fixed.

A Python list or a Java ArrayList is dynamic: add and remove as you like.

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

Static — an array

  • Size fixed at creation; one contiguous block of memory
  • Fast — position 20 is found by arithmetic, not by searching
  • No wasted effort resizing, because it never resizes
  • Unused places still occupy memory
  • Running out means creating a bigger one and copying

Dynamic — a list

  • Grows and shrinks as the program runs
  • Uses only what it currently needs
  • Flexible — you need not know the size in advance
  • Growing sometimes means moving everything to a bigger block
  • A little slower, and uses some extra memory for bookkeeping
Why a static array is fast: Everything sits in one block, each item the same size. So the address of item 20 is just the start plus twenty item-widths — one calculation.

Nothing is searched for, which is why reading by position is O(1).
What growing actually costs: A dynamic structure that outgrows its block must claim a bigger one and copy everything across.

That single operation is expensive — but it happens rarely, so the average cost of adding stays low.

Know your predicted grade

Take timed mock exams and get detailed feedback on every answer. See exactly where you're losing marks.

Try Mock Exams FreeYour first topic is free to keep • No credit card required
1

Known, fixed size — static

The 12 months of a year, the 7 days of a week, the 64 squares of a chessboard.

The size cannot change, so fixing it costs nothing and gains speed and simplicity.

2

Unknown or changing size — dynamic

Students joining a club, items in a shopping basket, lines read from a file.

An array would mean guessing a maximum: too small and it breaks, too large and most of it is wasted.

3

Very large and tightly packed — static

Millions of readings processed repeatedly, where memory and speed both matter.

The contiguous block is efficient to store and fast to scan in order.

4

Frequent adding and removing — dynamic

A queue of jobs, or a list being filtered.

Removing from the middle of an array means shifting everything after it along; a dynamic structure handles that for you.

The honest summary: Static trades flexibility for speed and predictability. Dynamic trades a little speed and memory for not having to know the future.

Most modern code uses dynamic structures by default, and reaches for arrays when the size is genuinely fixed.
When memory is tight: On an embedded device with little memory and strict timing, dynamic structures are risky. Memory use and timing become unpredictable as they grow at run time, each item may carry an extra pointer, and memory that is never freed (a leak) can crash the device.

A fixed-size array is predictable.

How this is tested — you must compare on the guide's own factors — speed, memory and flexibility. It comes up two ways:

Paper 2 — working with code

  • Compare static and dynamic structures, 3-5 marks
  • Choose one for a described scenario
  • Explain what happens when a structure grows

Paper 2 — the algorithmic-thinking question

  • Justify a choice from how the data behaves
  • Explain the cost of resizing, with no code shown
The classic trap: Saying dynamic is better because it is flexible. Flexibility is one factor of three — a static array is faster and uses memory more predictably, which is why fixed-size data still uses one.
IB-style questionCompare[5 marks]

A weather station records a temperature every hour for a year, and separately keeps a list of alerts raised, which may be none or hundreds. Compare static and dynamic structures for each.

Model answer plan

See the answer broken into clear points, with guidance on how each point earns marks.

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Static vs dynamic structures. Write your answer and get instant AI feedback — just like a real IB examiner.

how many elements must be moved to insert a value at position 200 of an array holding 1000 elements. [2 marks]

Related Computer Science Topics

Continue learning with these related topics from the same unit:

6.1.1Variables and data types6.1.2Substrings6.1.3Exception handling6.1.4Debugging
View all Computer Science topics
Improve your exam techniqueCommand terms, paper structure, and mark-scheme tips for Computer Science
Previous6.1.4DebuggingNextArrays and lists6.2.2

20 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 Topics