Insertion Sort

A sorting technique that builds the sorted array one element at a time, inserting each new element into its proper position among already-sorted elements.

  • Time complexity is Quadratic, i.e. O(n^2)
  • Space complexity is Constant, i.e. O(1)