Is it possible to find distance between 2 nodes of a generic tree without lowest common ancestor (or path from root)
In case of Binary Trees, It is possible to find the distance between the two nodes without finding the path from the root node or lowest common ancestor.
I was wondering if it is possible in the case of generic trees. As finding Lowest common ancestor is possible in generic as shown in below code.
Is it possible to find distance between 2 nodes of a generic tree without lowest common ancestor (or path from root)
In case of Binary Trees, It is possible to find the distance between the two nodes without finding the path from the root node or lowest common ancestor.
I was wondering if it is possible in the case of generic trees. As finding Lowest common ancestor is possible in generic as shown in below code.
Is it possible to find distance between 2 nodes of a generic tree without lowest common ancestor (or path from root)
In case of Binary Trees, It is possible to find the distance between the two nodes without finding the path from the root node or lowest common ancestor.
I was wondering if it is possible in the case of generic trees. As finding Lowest common ancestor is possible in generic as shown in below code.
Is it possible to find distance between 2 nodes of a generic tree without lowest common ancestor (or path from root)
In case of Binary Trees, It is possible to find the distance between the two nodes without finding the path from the root node or lowest common ancestor.
I was wondering if it is possible in the case of generic trees. As finding Lowest common ancestor is possible in generic as shown in below code.
Is it possible to find distance between 2 nodes of a generic tree without lowest common ancestor (or path from root)
In case of Binary Trees, It is possible to find the distance between the two nodes without finding the path from the root node or lowest common ancestor.
I was wondering if it is possible in the case of generic trees. As finding Lowest common ancestor is possible in generic as shown in below code.
Is it possible to find distance between 2 nodes of a generic tree without lowest common ancestor (or path from root)
In case of Binary Trees, It is possible to find the distance between the two nodes without finding the path from the root node or lowest common ancestor.
I was wondering if it is possible in the case of generic trees. As finding Lowest common ancestor is possible in generic as shown in below code.