Skip to content

Commit 96caab1

Browse files
authored
Update treeBasics
1 parent 2c92c63 commit 96caab1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

treeBasics

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11

2+
1) The maximum number of nodes at level ‘l’ of a binary tree is 2^l-1.
3+
4+
3) In a Binary Tree with N nodes, minimum possible height or minimum number of levels is ? Log2(N+1)
5+
6+
4) A Binary Tree with L leaves has at least ? Log2L ? + 1 levels
7+
8+
Full Binary Tree A Binary Tree is full if every node has 0 or 2 children.
9+
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
10+
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.
11+
A degenerate (or pathological) tree A Tree where every internal node has one child. Such trees are performance-wise same as linked list.
12+
13+
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.

0 commit comments

Comments
 (0)