Insertion Sort Visualizer

0 elements
50%
Comparisons: 0
Swaps: 0
Status: Idle

Insertion Sort Explained

Insertion Sort builds the sorted array one item at a time by inserting each element into its correct position within the sorted portion.

Algorithm Characteristics

  • Time ComplexityO(n²) / O(n)
  • Space ComplexityO(1)
  • StabilityYes
  • AdaptiveYes

Key Properties

  • Builds the sorted array one element at a time

  • Adaptive: performs well on nearly sorted data

  • Stable: maintains order of equal elements

  • In-place: requires no extra memory

Insertion Sort is ideal for small datasets or as a building block in hybrid algorithms