An Array data structure, or simply an Array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. The simplest type of data structure is a linear array, also called one-dimensional array. From Wikipedia
Arrays are among the oldest and most important data structures and are used by every program.
They are also used to implement many other data structures.
Average
Access | Search | Insertion | Deletion |
---|---|---|---|
O(1) | O(n) | O(1) | O(n) |
check the code and the test