Various Type of Binary Tree DS

MOHD RAZA
1 min readJun 29, 2022

--

1.Proper Binary tree/Strict Binary tree/Full binary tree

Def-Either two or no children for each nodes

Important property of Proper /full /strict binary tree

>>Maximum number of nodes in a binary tree of height 2^(h+1) -1

>>Strictly binary tree with n leaves always contain — 2n-1

>>Maximum number of nodes at any level ‘L’ in a binary tree-2^L

2.Complete Binary Tree

Def-All internal nodes are completely filled except for the nodes at the last level.

,the nodes must be filled from as left as possible

>>Max number of nodes present in a complete BT of a height 2^(h+1) -1

>>Min number of nodes present in a complete BT of a height 2^h

>>Max number of nodes present in a complete BT of a height 2^(h+1) -1

3.Perfect binary tree

Def-Each of its nodes has strictly 2 children and all its nodes at the same level

>>Same as above

4.Degenerate Binary tree

Def-All its internal nodes have strictly one child node except for the leaf node

5.Balanced Binary Tree

Def-The height of the left and right subtree for each node differ by at most 1.

example avl tree , red black tree;

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response