二叉堆是否支持减键操作?
根据http://en.wikipedia.org/wiki/Heap_%28data_struct%29#Comparison_of_theoretic_bounds_for_variants,需要 θ(logn) (转换为 O(logn))来执行减键操作。但是,似乎没有站点包含具有减少键操作的二进制堆实现。
鉴于网络上缺乏实现,是否可以在二进制堆中执行减少键操作?
According to http://en.wikipedia.org/wiki/Heap_%28data_structure%29#Comparison_of_theoretic_bounds_for_variants, it takes Θ(logn) (which translates to O(logn)) to perform the decrease-key operation. However, there seems to be no site that includes a binary heap implementation with a decrease-key operation.
Given therefore the lack of implementations on the web, is it possible to perform the decrease-key operation in a binary heap?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现:
I figured this out: