A data structure is a way of organising
data so that it can be efficiently processed using simple algorithms.
An array is an example of a data
structure.
An array is a 'list'
of data items which are all the same data type.
The data items in an array are called its elements.
Each element has a subscript to
identify it (usually a number...but not necessarily).
A one-dimensional array is an array where each item is identified by
one subscript.
Example : An array of
strings
called 'NAME' .
Subscript |
Name |
0 |
Julie Stephenson |
1 |
Amanda Platt |
2 |
John Kingsley |
3 |
Nita Cardigan |
4 |
Linda Hanson |
5 |
Oscar Nominee |
NAME[2] denotes the element of the array
NAME which has subscript 2 - ie
'John Kingsley'.
|