Why arrays aren’t “just lists.”
They looked like the same thing to me. The difference is in how the computer actually stores them in memory.
What I thought
An array and a list were two words for the same idea — a bunch of things in a row. I used them interchangeably in my head.
What actually happens
An array is a block of memory laid out end to end. Because everything is the same size and next to each other, the computer can jump straight to item number five with a little arithmetic.
That’s why reading by position is so fast — and why inserting in the middle can be slow, since everything after it may have to shift.
address(item i) = start + i × sizeWhat confused me
Why inserting into the middle was described as “expensive”. Once I pictured the memory physically, it made sense — there’s no free space between neighbours.
What finally made sense
The data structure isn’t just an idea; it’s a decision about memory. The shape you choose changes what is cheap and what is costly.
What I’m looking at next
Linked lists — and why they trade fast lookups for flexible inserts.
Written while figuring it out. Possibly wrong in places — that’s part of learning.
What happens after you type a URL?