1D Arrays
A one-dimensional (1D) array is a collection of items of the same data type.
- To declare an array in pseudocode, use the syntax:
DECLARE arrayName[n] OF dataType
- To declare an array in Python, use the syntax:
array_name = [0] * n
- In Java, use the syntax:
dataType[] arrayName = new dataType[n];
- In Visual Basic, use the syntax:
Dim arrayName(n) As dataType
To access elements in a 1D array, use the index, which can start at 0 or 1.