Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Insertion sort

Instructions

Sort list of numbers from lowest number to greatest number using insertion sort.

Algorithm

  • Start from the 2nd element of the list
  • Compare 2nd element with one before and insert it if necessary
  • Continue to next element and if it is in the incorrect order, iterate through "sorted portion" to place element at correct position.

Challenge | Solution