Say we have an array of n
elements:
int array[n];
If we wanted to access the first (or any) element of the array this would be O(1)
since it doesn’t matter how big the array is, it always takes the same constant time to get the first item:
x = array[0];