Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of thelongestpath between any two nodes in a tree. This path may or may not pass through the root. Example: Given a binary tree 1 / \ 2 3 / \ 4 5 R...
https://www.geeksforgeeks.org/diameter-of-a-binary-tree/ The diameter of a tree T is the largest of the following quantities: * the diameter of T’s left subtree * the diameter of T’s right subtree * the longest path between leaves that goes through the root of T (this can be co...
www.geeksforgeeks.org/diameter-of-a-binary-tree/
http://www.geeksforgeeks.org/diameter-of-a-binary-tree/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 struct node