Array Information Technology

Array Information Technology

Array information technology is made of rows and columns. They are used to store data confidently so it can be easily accessed. The array is a two-dimensional array where every collection element is an integer. The data stored in the exhibition is represented linearly.

Various types of arrays are available in the market, like one-dimensional arrays, two-dimensional arrays, and three-dimensional arrays. In the following article, we will discuss the two-dimensional array.

Types of Two-Dimensional Arrays

One-dimensional array: An array is called one-dimensional when it is used to store the data of only one row. Suppose you are keeping the data of only one row, and then the type of array is a one-dimensional array. For example, if you want to store the first row’s data, then the type of array is a one-dimensional array.

Two-dimensional array: If you want to store the data of two rows and two columns, then the array type is a two-dimensional array. For example, if you want to keep the data of a first row and a second row, then the array type is a two-dimensional array.

Three-dimensional array: If you want to store the data of three rows and three columns, then the type of array is a three-dimensional array. For example, if you want to keep the data of a first, second, and third row, then the type of array is a three-dimensional array.

Examples of Two-Dimensional Arrays

Example 1: Let us assume that you want to store the data of the numbers from 0 to 9 in a two-dimensional array.

To achieve this task, you will create a two-dimensional array that will store the data of nine elements.

Explanation: The elements of a two-dimensional array are of two types, the first is the row number, and the other one is the column number. So, to store the data of nine elements, you will create an array of nine rows and columns.

Example 2: You want to store the data of the numbers from 0 to 100 in a two-dimensional array.

To achieve this task, you will create a two-dimensional array that will store the data of 100 elements.

Explanation: The elements of a two-dimensional array are of two types, the first is the row number, and the other one is the column number. So, to store the data of 100 elements, you will create an array of 100 rows and columns.

Example 3: You want to store the data of the numbers from 0 to 50 in a two-dimensional array.

To achieve this task, you will create a two-dimensional array that will store the data of 50 elements.

Explanation: The elements of a two-dimensional array are of two types, the first is the row number, and the other one is the column number. So, to store the data of 50 elements, you will create an array of 50 rows and columns.

Share