Created
March 18, 2015 20:08
-
-
Save lettergram/8c11886ff1d504c5e061 to your computer and use it in GitHub Desktop.
Merge Sort on Slide
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
// Runs MergeSort algorithm on a slice single | |
func MergeSort(slice []int) []int { | |
if len(slice) < 2 { | |
return slice | |
} | |
mid := (len(slice)) / 2 | |
return Merge(MergeSort(slice[:mid]), MergeSort(slice[mid:])) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment