Microsoft Interview Question

Calculate the difference between two longest related nodes in a binary tree.

Interview Answer

Anonymous

Feb 7, 2020

Find hight in all nodes and the node with the biggest difference is the root for the nodes you are looking for. Sub the differences in his son nodes.