Created
January 15, 2017 07:59
-
-
Save cipepser/a7dace84aae086af18858a69693ad9c4 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
package MySort | |
func BubbleSort(a []int) { | |
for i := 0; i < len(a) - 1; i++ { | |
for j := 0; j < len(a) - i - 1; j++ { | |
if a[j] > a[j + 1] { | |
a[j], a[j + 1] = a[j + 1], a[j] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment