实现使用链表二叉堆 [英] Implementing a binary heap using a linked list

查看:470
本文介绍了实现使用链表二叉堆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/5518572/linked-list-implementation-of-binary-min-heap-having-trouble-with-manipulation">Linked列表实现二进制最小堆(经与操作和hellip麻烦;)的

问候,

我在遇到麻烦找出一种算法,会给我一个树节点的位置在一个链表实现二进制堆。我实现了使用数组现在我想尝试使用链表堆;有没有办法找到树节点的数组索引本来我有我使用一个数组来重新present堆?

I'm having trouble figuring out an algorithm that will give me the location of a tree node in a linked list implementation of a binary heap. I've implemented a heap using arrays now I want to try using a linked list; Is there a way to find the tree node whose array index would have been i had I used an array to represent the heap?

推荐答案

看看的迈克尔Springmann实施

这篇关于实现使用链表二叉堆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆