Algorithms

Dynamic array

An array that, when full, moves itself into a bigger one by copying its elements. That way you can add without knowing the size in advance.

Example

With capacity 10, adding the 11th element moves it to 20 slots. Python's list and Java's ArrayList work this way.

Test yourself: Dynamic array

Dynamic lists

What problem does a dynamic array solve?

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.