Array

Description of the data structure of the array.

Pros:

  • Fast insert (1 step). But with a check for duplicates(N steps).
  • Very fast access by an index. (1 step).

Cons:

  • Slow search (between N/2 and N steps).
  • Slow delete (search + delete + element shifting between N/2 and N steps in total N steps).
  • Fixed size (Array size cannot be increased or decreased).