Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.03 KB

File metadata and controls

28 lines (20 loc) · 1.03 KB

Single and Multi-dimensional arrays

Use arrays (or equivalent) in the design of solutions to simple problems

What is an array?

An array is a collection of data items of the same data type. Each item can be accessed directly via it's index (position in the array).

Array access is very fast as each element can be accessed directly.

What is a multi-dimensional array?

A multi-dimensional array is an array with more than one dimension. Think of it as a series of arrays inside of eachother.

An n-dimensional array can be represented mathematically as an n-dimensional matrix.

Uses of a multi-dimensional array

A multi-dimensional array may be used when representing a matrix.

Additional information

A one-dimensional array is a useful way of representing a vector. A two-dimensional array is a useful way of representing a matrix. More generally, an n-dimensional array is a set of elements with the same data type that are indexed by a tuple of n integers, where a tuple is an ordered list of elements.