Skip to content
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

Rewrite heapsort with a lambda #1

Open
alisianoi opened this issue Oct 23, 2017 · 0 comments
Open

Rewrite heapsort with a lambda #1

alisianoi opened this issue Oct 23, 2017 · 0 comments

Comments

@alisianoi
Copy link
Collaborator

Heapsort first builds a heap and then uses it to sort the list. If you want final order to be non-decreasing, then the heap must be "largest first" and vice versa. So, current API is broken: you must provide an std::greater if you want non-decreasing order when you normally would provide an std::less

Fix it with an on-the-fly lambda?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant