Skip to content

Conversation

@chin123
Copy link
Contributor

@chin123 chin123 commented Jun 28, 2018

Adds a Go implementation for bubble sort. If you have Go installed, you can do go run bubbleSort.go
Edit: Also I'm not sure whether I'm supposed to add myself to the Contributors list yet, so I haven't.

@Butt4cak3 Butt4cak3 added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Jun 28, 2018
Copy link
Contributor

@zsparal zsparal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the two nitpicks about fmt.Println it seems good


func main() {
array := [10]int{1, 45, 756, 4569, 56, 3, 8, 5, -10, -4}
fmt.Println("Unsorted array:")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just fmt.Println("Unsorted array: ", array)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to this format in both the cases, thanks!


bubbleSort(array[:])

fmt.Println("Sorted array:")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, why not just: fmt.Println("Sorted array: ", array)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, its simpler this way, I changed it. Initially it was like that because I wanted it to be like the output format of the C bubble sort.

@zsparal zsparal merged commit 320c980 into algorithm-archivists:master Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)

3 participants