Created
March 30, 2015 06:43
-
-
Save mistadikay/47bd66a54d4a586783e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let insertionSort = (arr) => { | |
for (let i = 0; i < a.length; i++) { | |
let toCmp = arr[i]; | |
for (let j = i; j > 0 && toCmp < a[j - 1]; j--) | |
arr[j] = a[j - 1]; | |
arr[j] = toCmp; | |
} | |
return arr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment