Array Time Complexity


#1

Hi, I wonder what’s the average time complexity and amortized time complexity of these operations:

  • shift / unshift
  • pop / push
  • slicing (arr[range] and arr[start, length])

It’d be great if you can laso explain the reason of its complexity behind each operation. THX.

Also what’s the default size of array, and when it’s expanding its size, what’s the factor of it.