1 # 完全树 最小堆 2 class CompleteTree(list): 3 def siftdown(self,i): 4 """ 对一颗完全树进行向下调整,传入需要向下调整的节点编号i 5 当删除了最小的元素后,当新增加一个数被放置到堆顶时, 6 ...
分类:
编程语言 时间:
2015-07-31 18:10:57
阅读次数:
159
题目:
Given a complete binary tree, count the number of nodes.
Definition of a complete binary tree from Wikipedia:
In a complete binary tree every level, except possibly the last, is completel...
分类:
编程语言 时间:
2015-07-09 22:42:58
阅读次数:
266