Skip to content

Add Bogo sort in Scala #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 24, 2018
Merged

Add Bogo sort in Scala #540

merged 2 commits into from
Dec 24, 2018

Conversation

jaoel
Copy link
Contributor

@jaoel jaoel commented Nov 3, 2018

No description provided.

@Gathros Gathros added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Nov 5, 2018
@jiegillet
Copy link
Member

It looks great to me, the only thing I'd like to have is more output, like "The unsorted list is ... The sorted list is ...".
@kenpower would you like to try your hand at reviewing? Let's have a review by someone who actually knows Scala for a change :)

@kenpower
Copy link
Contributor

kenpower commented Nov 8, 2018

hi @jaoel, great to see another Scala programmer here

def main(args: Array[String]): Unit = {
val unsorted = List(5, 2, 7, 1, -5)
val sorted = bogoSort(unsorted)
println(sorted)
Copy link
Contributor

@kenpower kenpower Nov 8, 2018

Choose a reason for hiding this comment

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

I agree with @jiegillet, for consistency with the other examples, we should output the sorted and unsorted list e.g from bubble sort.

val unsorted = List(9, 2, 0, 5, 3, 8, 1, 9, 4, 0, 7, 0, 9, 9, 0)

println("Unsorted list is " + unsorted)
println("  Sorted list is " + bubbleSort(unsorted))

Copy link
Contributor

@kenpower kenpower left a comment

Choose a reason for hiding this comment

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

Great submission, clean and easy to read!

Copy link
Member

@leios leios left a comment

Choose a reason for hiding this comment

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

Sorry it took me so long to see this review. Don't know what happened, it must have fallen through the cracks. Thanks a bunch @kenpower !

@leios leios merged commit 09e5b96 into algorithm-archivists:master Dec 24, 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.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants