完全二叉树叶子节点的个数
摘要:【转载】地址:云中孤鹜 题目:一个具有n个节点的完全二叉树,其叶子节点的个数为多少? 分析: 设叶子节点个数为n0,度为1的节点个数为n1,度为2的节点个数为n2 侧有 n0+n1+n2=n (1) 对于二叉树有: n0=n2+1 (2) 由(1)(2) ==> n0=(n+1-n1)/2 (3)
阅读全文
posted @ 2018-03-05 09:22
posted @ 2018-03-05 09:22