Back to Topic 6.2 — Data structures
6.2.1Computer Science SL5 flashcards

Static vs dynamic structures

Practice Flashcards

Flip to reveal answers
Card 1 of 56.2.1
6.2.1
Question

What is the difference between a static and a dynamic data structure?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Static vs dynamic structures

Sign up free to track progress and get spaced-repetition review schedules.

Card 1comparison

Question

What is the difference between a static and a dynamic data structure?

Answer

A static structure has its size fixed when it is created, in one contiguous block of memory. A dynamic structure grows and shrinks while the program runs, taking more memory only when it needs it.

Card 2concept

Question

Why is reading a position in a static array fast?

Answer

Everything sits in one block with items of equal size, so the address of item 20 is simply the start plus twenty item-widths. It is one calculation, with nothing searched for — O(1).

Card 3concept

Question

What does a dynamic structure cost when it grows?

Answer

When it outgrows its block it must claim a bigger one and copy everything across. That single operation is expensive, but it happens rarely, so the average cost of adding an item stays low.

Card 4concept

Question

When should you choose a static structure?

Answer

When the size is genuinely fixed — twelve months, seven days, sixty-four squares — or when a very large amount of data is scanned repeatedly and both speed and predictable memory matter.

Card 5concept

Question

Why is a fixed-size array wrong for an unknown number of items?

Answer

You must guess a maximum. Guess too small and it overflows or silently discards data; guess too large and most of the memory is never used — with still no guarantee the guess was enough.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free