Skip to content

feat: stable min heap data structure#91

Merged
roman-kashitsyn merged 13 commits into
mainfrom
roman-min-heap
Jun 28, 2023
Merged

feat: stable min heap data structure#91
roman-kashitsyn merged 13 commits into
mainfrom
roman-min-heap

Conversation

@roman-kashitsyn

Copy link
Copy Markdown
Contributor

This change introduces the MinHeap stable structure analogous to std::collections::BinaryHeap.
Contrary to BinaryHeap, MinHeap prioritizes smaller items, which I found much more useful in practice than prioritizing larger items.

This change introduces the `MinHeap` stable structure analogous to
`std::collections::BinaryHeap`.
Contrary to `BinaryHeap`, `MinHeap` prioritizes smaller items, which I
found much more useful in practice than prioritizing larger items.
@roman-kashitsyn roman-kashitsyn marked this pull request as ready for review June 15, 2023 11:47
@roman-kashitsyn roman-kashitsyn requested a review from a team as a code owner June 15, 2023 11:47

@ielashi ielashi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice and simple, thanks!

Comment thread src/min_heap/tests.rs
Comment thread src/lib.rs Outdated
Comment thread src/min_heap.rs
@ielashi

ielashi commented Jun 22, 2023

Copy link
Copy Markdown
Contributor

Maybe also adding an example to the examples folder would be nice?

Comment thread src/min_heap.rs Outdated
@roman-kashitsyn

Copy link
Copy Markdown
Contributor Author

Maybe also adding an example to the examples folder would be nice?

I've added an example, PTAL.

@ielashi ielashi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Example also LGTM. Thanks @roman-kashitsyn!

@roman-kashitsyn roman-kashitsyn merged commit 2ae50df into main Jun 28, 2023
@roman-kashitsyn roman-kashitsyn deleted the roman-min-heap branch June 28, 2023 15:15
ielashi added a commit that referenced this pull request Jul 3, 2023
We've introduced a new min heap data structure in #91, and this version
makes it accessible to our users.

---------

Co-authored-by: Roman Kashitsyn <roman@dfinity.org>
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

Successfully merging this pull request may close these issues.

3 participants