-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Conversation
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 ...". |
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) |
There was a problem hiding this comment.
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))
There was a problem hiding this 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!
There was a problem hiding this 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 !
No description provided.