-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Min head with decrease key functionality #1202
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
Conversation
Please add at least one https://docs.python.org/3/library/doctest.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting there but I think one thing that we are missing in the ability to get the value given the key (name) as in print(myMinHeap("X")) # -> 1
Not much value in a heap that you can not get the data back out of ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! Congratulations and thanks!! 🍰
* Min head with decrease key functionality * doctest added * __str__ changed as per Python convention * edits in doctest * get_value by key added * __getitem__ added
I have added MinHeap data structure with decrease key function in O(logn) time. I have also added sample usage at the bottom.
Please let me know if there are any changes.