The diameter of binary tree is a longest path or route between any two any nodes in a tree. The path may or may not pass through the route.The diameter of tree also called its width is the number of nodes on the longest path between two end nodes.
Example:
Diameter 9 nodes through root Diameter 9 nodes not through root
Comments