pick root node and recurse on left and right subtrees