二元樹資料結構及其屬性
left child right siblings
root
/
chid __ sibling
(left) (right)
LeftChid | data | RightChild
data
/ \
LeftChild RightChild
tree
parent
|
child
also a tree
parent
/ \
child child
binary tree
parent
/
child
level (the bigger the level is, the worse the performance it takes)
leaf nodes numbers
degree2 nodes numbers
to observe this data type, we shall determine the max number of nodes in a binary tree of depth k and the relationship between the number of leaf nodes and the number of degree2 nodes in a binary tree.
below graph is a full binary tree of depth 4 with sequential node numbers:
1
2 3
4 5 6 7
8 9 10 11 12 13 14 15