-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Currently PriorityQueue
defaults to a max-heap and if you want to use it as a min-heap you need to overload Ord
and change the comparison.
But you should be able to use the default ordering and simply specify that you want a min-heap, so we can use it for types like (uint, &str)
for example.
The simple idea would be to simply make a new_min_heap
and a min_heap_with_capacity
constructors.
Thoughts?
nbro
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.