Arrays
Ordered collections of elements of the same data type stored in contiguous memory locations, accessed by integer indices. Arrays provide efficient random access to elements and form the basis for implementing other data structures. Fixed-size arrays have predetermined capacities, while dynamic arrays resize as needed. Arrays are fundamental to algorithms processing collections of data.
Formula
Element address = Base address + (Index × Element size)
Real World
Spotify stores your recently played 50 songs in an array, allowing instant access to any track by its position — tapping song number 23 retrieves it immediately without scanning through songs 1 to 22.
Exam Focus
Always use zero-indexing in trace tables — accessing index 5 in a 5-element array is out of bounds, a common exam trap.
How well did you know this?