-
Notifications
You must be signed in to change notification settings - Fork 350
Arrays
Vaidhyanathan S M edited this page Apr 11, 2021
·
1 revision
An array is a collection of items stored at contiguous memory locations. The elements of an array are of same data type. Each element of an array is identified by using index (or position) in that array.
For example:
Consider the array given below:
[1,2,3,4,5]
The element '1' is at position 0 while the element '4' is at position 3.
Advantages of using arrays:
- Arrays allow random access of elements. So it makes accessing elements by position faster.
- Arrays have better cache locality which forms a significant factor in improving performance.
Useful Links in this repository:
Need help? Feel free to contact me @ vaidhyanathan.sm@gmail.com