We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 06ed002 + 7ff7afc commit ec1eac4Copy full SHA for ec1eac4
problems/0100.相同的树.md
@@ -172,6 +172,22 @@ public:
172
173
Java:
174
175
+```java
176
+class Solution {
177
+ public boolean isSameTree(TreeNode p, TreeNode q) {
178
+ if (p == null && q == null) {
179
+ return true;
180
+ } else if (q == null || p == null) {
181
+ return false;
182
+ } else if (q.val != p.val) {
183
184
+ } else {
185
+ return isSameTree(q.left, p.left) && isSameTree(q.right, p.right);
186
+ }
187
188
+}
189
+
190
+```
191
Python:
192
193
Go:
0 commit comments