Arrays are random access, which means that access to any element
has the same cost.
a[i] is O(1).
Allocating a new array (not initializing the contents)
could be essentially O(1). However, since Java is type-safe,
the new array must be initialized for its contents type,
so creation of a new size n array costs O(n).
If the O(n) cost of array creation is amortized
over the n elements, the creation cost per
element is O(1).
Arrays are rigid: they cannot be expanded. One must either:
Get a new, larger array and copy the old contents into it, O(n)
Make the array over-sized, wasting some space.
If an array is larger than main memory, the cost to access
an element can be much larger due to disk paging. Cache memory also
affects array performance.