SORTING VISUALIZER -- INSERTION SORT

Comparision : 0

Swap : 0

Insertion Sort

  • Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part. It is an in-place algorithm and is stable in nature. The insertion sort is used when the array is has a small number of elements or when there are only a few elements left to be sorted.
  • Best Case Complexity: O(n)
  • Average Case Complexity: O(n2)
  • Worst Case Complexity: O(n2)
  • Space Complexity: O(1)
What Indicates Colors ?

Compare The Element

Swap The Element