Arrays
If you’re learning programming, one of the first and most fundamental data structures you’ll encounter is the array. Arrays are incredibly useful and show up all the time in code, so having a solid grasp of how they work is essential. In this article, we’ll take an in-depth look at what arrays are, how they work under the hood, and some key operations and concepts. Let’s jump in! What is an array ? Fundamentally, an array is an abstract data type (ADT) that stores a collection of elements, each of which is identified by an index. An ADT is a mental model that defines a set of properties and operations that a data structure must have. For an array for example we want the index is a non-negative integer and that integer will represent the position of an element in the array. We also want to have some operations on the array, such as accessing an element, updating an element, deleting an element, and searching for an element. ...