Skip to content

Instantly share code, notes, and snippets.

@cedricconol
Created May 5, 2020 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedricconol/4f91319b77a96fdfdf3b46d6cc9d2987 to your computer and use it in GitHub Desktop.
Save cedricconol/4f91319b77a96fdfdf3b46d6cc9d2987 to your computer and use it in GitHub Desktop.
bubblesort function in go
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