Array
This data structure consists of a collection of elements of the same memory size, where each one is identified by an index. This comes with a function to map index’s to memory location of each element. (This is normally integer index with a contiguous memory block.) These can static where you fix the size of the array before hand or dynamic where you allow the array size to change.
This has spacial complexity of
to store elements and overhead if the indexing function is sufficiently simple. This has the following operations:
- Access:
- Update:
- Copy:
If this is a dynamic array meaning you can resize it, it will also have - Insert
if at the end in a given position - Delete
if at the end in a given position