Explain what is an Array?

Technology CommunityCategory: ArraysExplain what is an Array?
VietMX Staff asked 3 years ago

An array is a collection of homogeneous (same type) data items stored in contiguous memory locations. For example if an array is of type “int”, it can only store integer elements and cannot allow the elements of other types such as double, float, char etc. The elements of an array are accessed by using an index.

  • O(1)
  • O(log n)
  • O(n)
  • O(n log n)
  • O(n2)
  • O(2n)
  • O(n!)