In this article we have explored the algorithm on how to find the diameter of the tree using height of each node. This will take linear time O(V+E) time complexity.
What is Diameter of a tree ?
Diameter of tree is defined as the no. of nodes in the longest path between leaf nodes nodes of a tree ( undirected graph ) , it is also called the width of the tree.
How to find diameter of the tree ?
Well , there are two more methods apart from the methods mentioned in this article to find the...
Published on December 08, 2020 13:12