Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update output format of Go Bubble Sort
  • Loading branch information
chin123 committed Jun 29, 2018
commit 06f63aa00a61303c232a839438db098782d68e5a
12 changes: 2 additions & 10 deletions chapters/sorting_searching/bubble/code/go/bubbleSort.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,9 @@ func bubbleSort(array []int) {

func main() {
array := [10]int{1, 45, 756, 4569, 56, 3, 8, 5, -10, -4}
fmt.Println("Unsorted array:")
for i := 0; i < len(array); i++ {
fmt.Print(array[i], " ")
}
fmt.Println()
fmt.Println("Unsorted array:", array)

bubbleSort(array[:])

fmt.Println("Sorted array:")
for i := 0; i < len(array); i++ {
fmt.Print(array[i], " ")
}
fmt.Println()
fmt.Println("Sorted array:", array)
}