Data Structures · intro

Array vs Linked List

See contiguous array cells beside pointer-linked nodes — and why random access cost differs.

01 / 06

Array = contiguous slots

Array

A0B1C2D3

Contiguous cells

An array stores elements in adjacent memory slots. Index 0, 1, 2 sit next to each other.

Layout

Address of index i is base + i × element_size.

Space play/pause · ← → step · [ ] speed · Home/End jump