Guided Notes

Arrays & Time Complexity

How arrays work, the cost of common array operations, and analyzing an algorithm's time and space.

Arrays

Slide 1 / 5

An array stores elements one after another in memory, each reachable by its index:

my_array = [7, 12, 9, 4, 11] my_array[0] → 7

Because elements sit side by side, the computer can jump straight to any index — reading my_array[3] takes the same time whether the array has 5 or 5 million elements.

Python lists are dynamic arrays: they grow automatically. Many languages (C, Java) have fixed-size arrays.

← Introduction to DSA