Skip to content

Rewrite heapsort with a lambda #1

Description

@alisianoi

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions