Arrays 101: Applications, Advantages, and Disadvantages of Using Arrays

Understanding Arrays (Part III)

Sushmita Singh
Code  Writers

--

Photo by Clément Hélardot on Unsplash

An array is a linear data structure and is used to store multiple data elements of the same type together at contiguous memory locations. It is one of the most simple and really, most popular data structures.

In this article, we will talk about the applications, advantages, and disadvantages of using arrays as a data structure.

Applications of Arrays

#1. Used to store values of the same data type

Arrays are used to store homogeneous data types, i.e. data elements of the same data type.

Also, using arrays, we can maintain multiple variable names using a single name. For example, instead of using 100 different variables to store the marks of students in our class, we can use a single variable.

This avoids confusion and makes data easy to use and maintain.

#2. Used in mathematical problems

Using 2D arrays, we can create a matrix and then use these 2-D arrays to perform matrix operations.

Other than that we usually implement many database records as arrays as several databases…

--

--

Sushmita Singh
Code  Writers

Writer || Coder || Book Lover. Helping you evolve into the ultimate version of yourself. https://sushmitasingh.carrd.co/