Created
May 12, 2019 16:31
-
-
Save BetterProgramming/7049cf43ccec68c442ad0c2630500ba1 to your computer and use it in GitHub Desktop.
This file contains 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
const selectionSort = (nums) => { | |
checkLoopInvariant(nums, input, 0) //check during initialization | |
for (let i = 0; i < nums.length - 1; i++) { | |
checkLoopInvariant(nums, input, i) //check at each iteration | |
} | |
checkLoopInvariant(nums, input, nums.length) //check at the | |
return nums | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment