check a tree is symmetric or not