c*********t 发帖数: 2921 | 1 好像过去大概一个月左右的时候这里讨论过这个问题,找不到那个帖子了。
cracking the code interview (careercup)的书上说full, complete binary tree是
一回事,可是在别的地方看到的是full binary tree肯定是complete,但是complete
binary tree不一定是full.
我看到的是full binary tree,每个non-leaf node 肯定有两个children.但是complete
binary tree不是这样的。
谁能把那个帖子给弄出来?
谢谢! |
d********t 发帖数: 9628 | 2 题目不至于这么抠字眼吧,不如具体说明好了。
complete
【在 c*********t 的大作中提到】 : 好像过去大概一个月左右的时候这里讨论过这个问题,找不到那个帖子了。 : cracking the code interview (careercup)的书上说full, complete binary tree是 : 一回事,可是在别的地方看到的是full binary tree肯定是complete,但是complete : binary tree不一定是full. : 我看到的是full binary tree,每个non-leaf node 肯定有两个children.但是complete : binary tree不是这样的。 : 谁能把那个帖子给弄出来? : 谢谢!
|
s******n 发帖数: 226 | 3 不知道是什么帖子,但是full应该就是1:2:4:。。。2^n |
H****s 发帖数: 247 | 4 CLRS appendix 有定义,应该是权威定义了。 |
P**l 发帖数: 3722 | 5 不是一回事
full是对所有的node,要么没child,要么2个children
complete是除了最后一层,前面几层都填满node了,每层是1,2,4个node这种,最后
一层满不满无所谓,只要是从左向右没空着的就行 |
w******u 发帖数: 219 | 6 比如huffman编码的那个查找树,就是full binary tree而不是complete binary tree. |
w***o 发帖数: 6775 | 7 正解。。
【在 P**l 的大作中提到】 : 不是一回事 : full是对所有的node,要么没child,要么2个children : complete是除了最后一层,前面几层都填满node了,每层是1,2,4个node这种,最后 : 一层满不满无所谓,只要是从左向右没空着的就行
|