Contiguous memory
Data stored in adjacent memory spots, one next to the other. It lets you compute where each element is.
Example
An array starting at address 2,000 with 8-byte elements has element 10 at 2,000 + 10 × 8 = 2,080.
Test yourself: Contiguous memory
Types of structures
There's no large free block of memory left, only small loose gaps. Which structure still fits?
An array of 1 million 4-byte numbers needs 4 MB in a row. A linked list can put each node in a different gap.
0/1
â–¶ Play