What is a Binary Tree?

A Binary Tree is a Tree based data structure in which each node can have at most two children referred to as Left child and Right child. It can be localized in the same manner node, left child and right child and normally represented as LNR where L & R are left and right children respectively and N is the node.
An example is below.

Binary trees can be of various types.
1. Full Binary tree: Binary tree where every node has 0 or 2 children.
2. Perfect Binary tree: All interior nodes of the binary tree have 2 children and all leaves are at the same level
3. Complete Binary tree: Every level except possibly the last, is completely filled and all nodes on the last level are to the farthest left possible.

A variation of Binary Tree is the Binary Search tree.

core java 12


Explore Tutu'rself