Skip to content

1.1 Arrays and Dynamic Arrays

Fixed and dynamic arrays, resizing strategies, memory layout, cache effects, vectorization, and in-place operations.

indexslugname
1static-arrayStatic Array
2dynamic-arrayDynamic Array
3vector-resize-strategyResize Strategy
4circular-arrayCircular Array
5multidimensional-arrayMultidimensional Array
6jagged-arrayJagged Array
7array-slicingArray Slicing
8array-rotationArray Rotation
9prefix-sum-arrayPrefix Sum Array
10difference-arrayDifference Array
11sliding-window-arraySliding Window
12sparse-arraySparse Array
13bit-packed-arrayBit Packed Array
14dynamic-reserveCapacity Reservation
15amortized-analysis-arrayAmortized Analysis
16array-partitionPartitioning
17array-stable-partitionStable Partition
18array-reversalReversal
19array-shuffleShuffle
20array-scanLinear Scan
21array-compactionCompaction
22array-deduplicationDeduplication
23array-mergeMerge
24array-intersectionIntersection
25array-unionUnion
26array-binary-layoutMemory Layout
27array-copyingCopy Strategies
28array-bufferingBuffering
29array-index-mappingIndex Mapping
30array-bounds-checkBounds Checking
31array-stride-accessStride Access
32array-blockingBlocking
33array-tilingTiling
34array-vectorizationVectorization
35array-alignmentAlignment
Dynamic ArrayResizable array that grows and shrinks automatically while preserving contiguous storage.
3 min
Circular ArrayArray that wraps indices modulo capacity to support efficient cyclic access.
3 min
Multidimensional ArrayStore values indexed by two or more dimensions using a linear memory layout.
3 min
Jagged ArrayStore rows of different lengths as an array of arrays.
3 min
Array SlicingRepresent a contiguous subrange of an array as either a view or a copied array.
3 min
Array RotationRotate elements of an array by a given offset in-place or using auxiliary space.
2 min
Prefix Sum ArrayPrecompute cumulative sums to answer range sum queries in constant time.
2 min
Difference ArrayRepresent range updates compactly by storing changes between adjacent values.
3 min
Sliding Window ArrayMaintain a contiguous window over an array while moving its left and right boundaries.
3 min
Sparse ArrayStore only non-default values from a large logical array.
3 min
Bit-Packed ArrayStore small integers or booleans using compact bit-level representation.
4 min
Capacity ReservationPreallocate array capacity to reduce reallocations and copying during growth.
3 min
Amortized AnalysisAnalyze the average cost per operation over a sequence of dynamic array operations.
3 min
Array PartitionRearrange elements so that those satisfying a predicate appear before others.
2 min
Stable PartitionPartition an array while preserving the relative order of elements inside each group.
3 min
Array ReversalReverse the order of elements in an array in-place using symmetric swaps.
2 min
Array ShuffleGenerate a uniform random permutation of an array in-place.
2 min
Array ScanTraverse an array sequentially to compute an aggregate or apply a function.
2 min
Array CompactionRemove elements in-place based on a predicate while preserving the remaining elements.
2 min
Array DeduplicationRemove duplicate values from an array while keeping one representative of each value.
2 min
Array MergeMerge two sorted arrays into a single sorted array.
2 min
Array IntersectionCompute the common elements between two arrays.
3 min
Array UnionCombine elements from two arrays into one collection without duplicates.
3 min
Memory LayoutUnderstand how arrays are stored in memory and how layout affects performance.
2 min
Array CopyingCopy array elements into a new storage block using shallow or deep copy semantics.
2 min
Array BufferingUse temporary array storage to stage data before writing it to its final location.
2 min
Index MappingMap logical array positions to physical storage positions.
3 min
Bounds CheckingValidate array indices before access to prevent invalid reads and writes.
2 min
Stride AccessAccess array elements at regular intervals and understand the effect on locality.
2 min
BlockingProcess an array in fixed-size blocks to improve cache locality and batch behavior.
2 min
TilingProcess multidimensional arrays in small rectangular regions to improve locality.
3 min
VectorizationProcess multiple array elements per instruction using SIMD-friendly layout and loops.
3 min
AlignmentPlace array elements at memory addresses that satisfy hardware and type alignment requirements.
3 min
PaddingInsert unused space between array elements or groups to control alignment and reduce interference.
3 min
Static ArrayStore a fixed number of elements in contiguous memory with constant-time indexing.
2 min