Skip to content

100-same-tree

DevGod
DevGod
Vtuber
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public boolean isSameTree(TreeNode p, TreeNode q) {
System.out.println(q.val);
System.out.println(p.val);
p = p.right;
System.out.println(p.val);
System.out.println(" ");
return false;
}
}