# Array (Data Structure)
## Data Structures — The Codex Coding
**URL:** https://thecodex.expert/coding/data-structures/arrays/
**Type:** data-structure | **Confidence:** high | **Last verified:** 2026-06-01

## CANONICAL DEFINITION
An array is a contiguous block of memory divided into equal-sized slots, where any slot can be accessed in O(1) time using its integer index and the formula base_address + index * element_size.

## COMPLEXITY
- access: O(1)
- search: O(n)
- insert: O(n)
- delete: O(n)
- append_amortised: O(1)
- space: O(n)

## REQUIRES
concepts/arrays, concepts/variables

## ENABLES
data-structures/hash-tables, algorithms/sorting

## COMMONLY CONFUSED WITH
Python list != C array; array decay in C (sizeof gives bytes not element count); O(n) insert/delete due to shifting

## SOURCES
- CLRS 4th ed. §17.4
- ISO C17 §6.3.2.1 §6.5.6
- Java Language Specification §10
- Knuth TAOCP Vol.1 §2.2

*The Codex Coding — thecodex.expert/coding/ — Free forever — Mumbai, India*
