forked from techhubmvit/dataStructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreeBasics
13 lines (8 loc) · 1 KB
/
treeBasics
1
2
3
4
5
6
7
8
9
10
11
12
13
1) The maximum number of nodes at level ‘l’ of a binary tree is 2^l-1.
3) In a Binary Tree with N nodes, minimum possible height or minimum number of levels is ? Log2(N+1)
4) A Binary Tree with L leaves has at least ? Log2L ? + 1 levels
Full Binary Tree A Binary Tree is full if every node has 0 or 2 children.
Complete Binary Tree: A Binary Tree is complete Binary Tree if all levels are completely filled except possibly the last level and the last level has all keys as left as possible
Perfect Binary Tree A Binary tree is Perfect Binary Tree in which all internal nodes have two children and all leaves are at the same level.
A degenerate (or pathological) tree A Tree where every internal node has one child. Such trees are performance-wise same as linked list.
Note that nodes are unlabeled. If the nodes are labeled, we get more number of trees. We can find the number of binary tree by Catalan number number: Here n = 3 Number of binary tree = (2nCn)/ n+1 = (2*3C3)/ 4+1 = 5. So, option (B) is correct.