array
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| array [June 11, 2026 at 09:42] – created - external edit 127.0.0.1 | array [June 13, 2026 at 03:13] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| # Array | # Array | ||
| - | An **array** is a fixed-size sequence of elements of the same type stored in contiguous memory. The index of an element determines its address: `base + index * sizeof(element)`. This means any element is reachable in O(1) time without traversal, and the memory layout is cache-friendly — iterating over an array touches sequential cache lines rather than chasing pointers. | + | An **array** is a fixed-size sequence of elements of the same type stored in contiguous memory. |
| + | |||
| + | The index of an element determines its address: `base + index * sizeof(element)`. This means any element is reachable in O(1) time without traversal, and the memory layout is cache-friendly — iterating over an array touches sequential cache lines rather than chasing pointers. | ||
| ```c | ```c | ||
array.1781170938.txt.gz · Last modified: by 127.0.0.1
