AlgoViz

Static arrays

easy 15 min

A static array is a fixed-size block of same-type slots stored side by side in memory.

A fixed-capacity array class

Read it, run it, change a line and run it again.

Loading editor…

The capacity is set once. get and set are O(1); insert_at and delete_at shift elements and cost O(n - i); search is O(n). Out-of-range indexes and a full array raise errors instead of failing silently.