Complete binary tree is a special kind of binary tree. It has all the nodes one by one. It does not need to be a full pyramid. Complete binary tree can be stored in an array, which is the main advantage of it. And the parent nodes and child nodes have relationship of index as 2i, 2i+1(depends on whether your index starts at 0 or 1).
Heap is a kind of complete binary tree.
Complete binary tree
最新推荐文章于 2022-07-21 14:36:39 发布