implement decreasing key in binomial heap

怎甘沉沦 提交于 2019-12-11 09:49:47

问题


in the binomial heap structure, we know only the pointer that points to the min node, but how can I decrease the key of arbitrary node? in this case, first of all, I should find this node and then perform swapping with O(lgN) time.

I search online and many points out how to decrease node but does not mention how to access this node to be decreased.

Edit:

I should use pointers that point to each node of the heap.


回答1:


Maybe I'm missing something here, but if you have the key to your 'arbitrary node' couldn't you just use an O(lg n) time lookup to find it, and then decrease it using the algorithm you found online?



来源:https://stackoverflow.com/questions/7774546/implement-decreasing-key-in-binomial-heap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!