add recursion version for symmetric tree