-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add m-ary heap #102
Comments
Please provide a more reliable reference, for example Wikipedia or research paper and discuss use cases and APIs on the basis of it. |
Referencehttps://en.wikipedia.org/wiki/D-ary_heap Use Casesm-ary heap when used in the implementation of priority queue allows faster decrease key operation as compared to binary heap ( O(log2n)) for binary heap vs O(logmn) for m-ary heap). Nevertheless, it causes the complexity of m-ary heap has better memory cache behaviour than a binary heap which allows them to run more quickly in practice, although it has a larger worst case running time of both extractMin() and delete() operation (both being O(m log mn) ). APIsbuildHeap() - Builds a heap from an input array. |
The above API can be modified so that it remains along the lines of current |
The above API can be modified so that it remains along the lines of current |
IMO, using arrays is a safer option. Pointer based implementation makes the maintenance of code difficult. Though, |
This also suggests array data structure as a support for the proposed type of heaps.
The above property can make it easy to add array implementation without creating a new class for nodes of |
Description of the problem
Currently, the package does not have m-ary heap (a generalization of the binary heap).
Example of the problem
References/Other comments
https://www.geeksforgeeks.org/k-ary-heap/
The text was updated successfully, but these errors were encountered: