Created
May 5, 2020 09:02
-
-
Save cedricconol/4f91319b77a96fdfdf3b46d6cc9d2987 to your computer and use it in GitHub Desktop.
bubblesort function in go
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
func bubblesort(list []int, ascending bool) { | |
var N int = len(list) | |
var count int | |
for i := 1; i < N; i++ { | |
pass(list, ascending) | |
count++ | |
} | |
fmt.Println("Number of iterations: ", count) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment