Introduction to the array data structure
Arrays are a popular data structure represented in various software languages, including machine code. You learned how to write them in C# in the previous chapter. Arrays are a set of spaces in computer memory that have been saved for data, where each space has a fixed size for the data. When you create an array in a computer program, the computer saves or allocates space for the data, a collection of spaces that live next to each other and can be found in a single location in computer memory, and gives each space a memory address, which is a unique location in computer memory, similar to a typical address. So, when you create an array with five items in it, the computer allocates five spaces for your data and gives each of them a memory address and index. This defines an array as a contiguous data structure, where the data is in one location and each item is in subsequent order. The opposite of this is a linked data structure, where there may...