Arrays Edited
Arrays Edited
[student]
[instructor]
[course]
[Submission date]
Arrays are used when storing many variables of the same type. An array is a sequence of
objects of the same data type(Gunnerson). It is used for storing multiple pieces of information
It saves memory. There is a dynamic allocation of memory in an array. This leads to the system
saving memory. There is manual allocation of memory at runtime in case the predefined array
does not have sufficient memory. The amount of required memory is dependent on the type of
data.
Cache friendly. The values of an array are near each other. There is easy access from the CPU to
the cache. This makes it easier in a case where one has to iterate over a large number of items.
Arrays have predictable timings. The access time of the items in an array is provided. The
system is aware of the exact address of the array. Accessing the array becomes fast and
Easier debugging. Compared to other data structures debugging is easier. This is because it has
specified indexes that allow for easy traversal(Marquis & Smith). The memory space required is
only for the values, the start address, and the length. The process of implementation is straight
surname2
forwards. The data stored in an array has to be homogenous. This makes it easier for
manipulation. The data is stored in a sequential manner making its tracking faster.
Reusability of code is easier. Once the array has been declared, it can be reused multiple times.
# Creation of Array
print()
Works cited
Marquis, Hank & Smith, Eric. Arrays and Array Manipulation. 10.1007/978-1-4302-5125-
5_1.2000