Array is a linear data structure consisting of a collection of elements which are stored in contiguous physical memory locations and identified by index

One dimensional array

Given a one-dimensional array A has 4 elements like the below image

Each element in the array can be accessed directly by A[0], A[1], A[2] and A[3] with the corresponding value 9, 2, 6 and 8

Traversal Example


Two dimensional array

Given a two-dimensional array A has 8 elements like the below image

Each element in the array can be accessed directly by A[0][0], A[0][1], A[0][2], A[0][3], A[1][0], A[1][1], A[1][2] and A[1][3] with the corresponding value 9, 2, 6, 8, 5, 7, 1 and 3

Traversal Example