Skip to content

chore: combine min/max heap. allow custom compare function. make some functions private. #138

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 1 commit into from
Jun 16, 2023

Conversation

caojoshua
Copy link
Contributor

  • allow for custom compare functions, which would be helpful for aggregate types. I would like to use this in feat: add dijkstra with adjacency list and heap increasePriority #134 to have a custom compare function for a 2-tuple.
  • reduces code that is mostly copy-pasted in isRightlyPlaced() and getChildIndexToSwap(). reduces copy and pasted comments.
  • make some functions protected -> private. No reason for child classes to access them.

@raklaptudirm raklaptudirm merged commit 112ea29 into TheAlgorithms:master Jun 16, 2023
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