Introduction
An array is the most basic data structure that allows us to store different variables of similar data type in a contiguous memory location. They exist in all programming languages, and are used as the basis for most other data structures.
Advantages
- Code optimization: We can retrieve or sort the data efficiently.
- Random access: We can get any data located at an index position.
Disadvantages
- Size limit: We can store only the fixed size of elements in the array. So, it doesn't increase or decrease its size at runtime.