What is an Array?
An array stores data sequentially in memory space.
Each element of an array can be addressed as an index. In most programming languages, the index of an array begins from 0.
Applications of Array
- Primary use: To store a list of items. For example: a to-do list, e-commerce shopping cart, names of employees, etc.
- Arrays can also be used to implement other data structures like Queues, Stacks, Binary Trees, etc. (click on each to learn how)
- Databases: Arrays are used in databases to store data sequentially.
- Image data can be stored in 2-dimensional arrays.
Array Operations & Algorithms
Search
Search operation involves searching for a particular element in an array of elements.
Search operations can be performed in an array through the following methods:
- Linear Search
- Binary Search
Sort
The sort operation involves arranging the elements of an array in either ascending or descending order.
Sort operation can be performed in an array through the following algorithms:
- Selection Sort
- Bubble Sort
- Quick Sort
- Merge Sort
- Insertion Sort
- Heap Sort
Add Comment