BCA / B.Tech 5 min read

What is an Array & Types of Arrays

What is an Array?

An array is a non-primitive and linear data structure that is a collection of similar data items. This means it will only store data of the same type, such as all integer data or all floating-point data. The array data structure is used to store a group of data objects.

"Arrays are static data structures, meaning we can only allocate memory at compile time and cannot change it at run-time."

Types of Arrays

Arrays are of the following three types:

1. One-Dimensional (1-D) Arrays:
An array with only one subscript is called a one-dimensional array. It is used to store data in a linear fashion.

What are arrays and types of arrays | One-Dimensional Array

2. Two-Dimensional (2-D) Arrays:
An array with two subscripts is called a two-dimensional array. Two-dimensional arrays are also called matrices and tables.

What are arrays and types of arrays

3. Multi-Dimensional (M-D) Arrays:
Arrays with more than two subscripts are called multi-dimensional arrays. They are useful for storing more complex data structures.

What are arrays and types of arrays

Benefits of Array Data Structure

The array data structure offers several benefits, such as:

  • Storing data in an organized manner.
  • Efficiently accessing and manipulating data.
  • Making it easy to work with data of the same type.

Where are Arrays Used?
Arrays are used in many types of applications, such as:

  • Database systems
  • Image processing
  • Scientific computing
  • Game development

This information provides a comprehensive understanding of the array data structure and how it can be used in various scenarios.