Insertion Sort
Numeric or Text sort (check box to see the difference)
# of elements:
Max element #:
Check if data is text
Here is a hard coded unsorted array:
The sorted array is:
Stats:
Passes (-P):
The animation below shows the steps in this sort:
The animation is from:
https://www.w3resource.com/javascript-exercises/searching-and-sorting-algorithm/searching-and-sorting-algorithm-exercise-4.php
where there is a more comprehensive explanation of this "Insertion sort". The code has been modified to remove the functions "unshift" and "splice".