Arrays
Master contiguous memory indexing, multi-language solutions, and interview concepts.
Select Set:
Static Array: Allocated on stack/heap with fixed size at compile/runtime. Size cannot be altered after declaration.
Dynamic Array (e.g., C++ std::vector, Java ArrayList): Automatically resizes when full. Usually doubles its capacity (Geometric Growth) to maintain an amortized O(1) insertion time complexity.
Arrays store elements in contiguous memory locations. The address of index i is calculated directly using a mathematical formula:
Address = Base_Address + (Index * Element_Size)
Because arithmetic calculation takes constant time regardless of array length, lookup is O(1).