๐Ÿ–‡ Array (programming)

= pluralization of homogeneous data structures

Types

Shape

  • Rectangular: same number of elements per dimension
    • faster, less storage, inflexible
    • int[,,] X = new int[,,] โ†’ rectangular 3D-Array
    • X[1,1,1] โ†’ get element (canโ€™t extract arrays)
  • Jagged: different number of elements per dimension
    • slower, more storage, flexible
    • int[][][] X = new int[][][] โ†’ jagged 3D-Array
    • X[1][1][1] โ†’ get element

Indexing

Comparison

โ†’ ๐Ÿ’ฅ Arrays Vs Lists