Finding diameter of a binary tree