find max distance of binary tree.