complete 二叉树可以有效地实现为数组,其中索引i处的节点具有索引 2i 和 2i+1 处的子节点以及索引 floor(i/2) 处的父节点,具有 one-based indexing .
如果子索引大于节点数,则子项不存在 .
我看到这些转换,但有 no formal proof of them ,可以给出严格的证据或链接,谢谢!
请参阅此链接Derivation of index equations这适用于基于0的索引 . 但也有基于1的索引的注释
1 回答
请参阅此链接Derivation of index equations这适用于基于0的索引 . 但也有基于1的索引的注释