Closed radlinskii closed 6 years ago
DecreaseKey and Delete are not part of the Heap Interface so it's not a big problem. But check my comments
So should I get rid of DecreaseKey and Delete and make the Heap implement Interface interface?
Also, what comments should I check?
Check the review comments: https://github.com/theodesp/go-heaps/pull/22/files
Its ok if you leave the DecreaseKey
and Delete
as they are I will probably refactor them later.
You just make the Heap implement the Interface
.
Thanx
Ok, I will make it implement the Interface interface. I can't see any of your comments though.
Ok, I will make it implement the Interface interface. I can't see any of your comments though.
Sorry I forgot to finish the review
Ta
Small preview:
I've implemented the algorithm straght from "Introduction to Algorithm". It's working. I can add some tests in addition to the examples.
There is one problem here tho. My implementations of DecreaseKey and Delete methods need the the reference to certain Node, it's not possible to provide it when the Heap is implementing the Interface interface because the Insert method wants a value of node's key, instead of the pointer to the node.
I would like to see it being merged and maybe a new issue created for implementing the Interface interface.