Lesson 5 · Arrays
An array is a data structure that organizes and stores data for efficient access and modification. It provides O(1) random access, meaning any element can be retrieved directly by its index in constant time. Arrays are a core data structure in computer science, used to store a fixed-size sequential collection of elements of the same type. Key variants include: one-dimensional arrays (linear list), multi-dimensional arrays (e.g., 2D arrays for matrices), and arrays of objects (reference type arrays). In Java, arrays are reference types, declared with square brackets (e.g., int[] numbers).