Skip to content

Added Bogosort in Coconut #735

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
Oct 15, 2020

Conversation

Amaras
Copy link
Member

@Amaras Amaras commented Jul 15, 2020

Well, it's not really interesting, but I used more idiomatic Python for the is_sorted function, iterating over the array and a shifted copy of the array, rather than over the indices.
That's basically all I did from the Python implementation, except removing the main function, that serves little purpose in Python.

for x, y in zip(a, a[1:]):
if x > y:
return False
return True
Copy link
Member

Choose a reason for hiding this comment

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

I would like to see a full FP solution rather than the Python solution. Folding the map comes to mind.

Copy link
Member Author

Choose a reason for hiding this comment

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

why reduce when you already have all built-in?
Thanks for the more functional style requests!

@berquist berquist added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Jul 19, 2020
@Amaras Amaras requested a review from berquist July 23, 2020 10:45
@berquist berquist merged commit 85f8e9a into algorithm-archivists:master Oct 15, 2020
@Amaras Amaras deleted the bogo_sort_coconut branch December 5, 2021 16:54
@Amaras Amaras restored the bogo_sort_coconut branch December 5, 2021 16:54
@Amaras Amaras deleted the bogo_sort_coconut branch December 5, 2021 16:54
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.

2 participants