[理工] 资结DS-tree

楼主: a0953781935 (欧尼酱)   2018-10-06 12:58:24
The number of paths from the root node to the leaf nodes is proportional to t
he number of nodes in the tree
这句话有错吗?对某个点来说path是唯一的,但对tree来说点越多path不是就越多吗?
作者: skyHuan (Huan)   2018-10-06 19:53:00
了解了感谢silence大原po知道答案吗,题目如果想问成正相关应该是true,如果是问成正比好像就像befdawn大讲的应该是false了
作者: silence0925 (小文青)   2018-10-06 14:05:00
回复S大 时间复杂度通常看比较或是交换次数 但走访没有 所以是看输出次数 n个点输出n次 所以O(n) 我是这样想的 有错再请各位纠正数学的话 递回是T(n)=2T(n/2)+1 用master就看的出来了回原po 他题目是问 从root到leaf
作者: befdawn (橙花雨露)   2018-10-06 14:00:00
skewed是跟点数正比(n),但full就不是吧(log n),可能是这个意思?
作者: skyHuan (Huan)   2018-10-06 13:32:00
"the" leaf应该只看特定leaf吧,感觉是要问树高是不是跟node数成正比的意思借版问一下,二元树的三种递回traversal(前/中/后序)的复杂度为什么是O(n)
作者: silence0925 (小文青)   2018-10-06 13:05:00
Skew 点越多 还是一条啊

Links booklink

Contact Us: admin [ a t ] ucptt.com