/*
public class TreeNode {
int val = 0;
TreeNode left = null;
TreeNode right = null;

public TreeNode(int val) {
    this.val = val;

}

}
*/
import java.util.ArrayList;
public class Solution {
static ArrayList<treenode>list=new ArrayList<>();</treenode>

boolean isSymmetrical(TreeNode pRoot)
{
    order(pRoot);
    for(int i=0;i<list.size()/2;i++){
        if(list.get(i).val!=list.get(list.size()-1-i).val){
            return false;
        }
    }
    return true;


}
public void order(TreeNode pRoot){
    if(pRoot!=null){
        order(pRoot.left);
        list.add(pRoot);
        order(pRoot.right);
    }
}

}