Iteration solution for checking symmetric tree