Insertion Sort
Performance Metrics
Array Size: 40
Number of Swaps: 0
Elements Checked: 0
How it works
Insertion Sort is a simple sorting algorithm that works like sorting playing cards in your hand. It starts with the first element as sorted and picks each next element, inserting it into its correct position among the already sorted ones. If needed, elements are shifted to make space. This process repeats until the entire list is sorted. While easy to understand, Insertion Sort is slow for large datasets, with a time complexity of O(n²) in the worst case.