File tree 3 files changed +44
-1
lines changed
3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 73
73
| [ 070] [ 070-question ] | [ Climbing Stairs] [ 070-tips ] | [ Easy] [ E ] | [ ✅] [ 070-java ] | [ ✅] [ 070-js ] | [ ✅] [ 070-kotlin ] |
74
74
| [ 083] [ 083-question ] | [ Remove Duplicates from Sorted List] [ 083-tips ] | [ Easy] [ E ] | [ ✅] [ 083-java ] | [ ✅] [ 083-js ] | [ ✅] [ 083-kotlin ] |
75
75
| [ 088] [ 088-question ] | [ Merge Sorted Array] [ 088-tips ] | [ Easy] [ E ] | [ ✅] [ 088-java ] | | [ ✅] [ 088-kotlin ] |
76
- | [ 100] [ 100-question ] | [ Same Tree] [ 100-tips ] | [ Easy] [ E ] | [ ✅] [ 100-java ] | | [ ✅] [ 100-kotlin ] |
76
+ | [ 100] [ 100-question ] | [ Same Tree] [ 100-tips ] | [ Easy] [ E ] | [ ✅] [ 100-java ] | [ ✅ ] [ 100-js ] | [ ✅] [ 100-kotlin ] |
77
77
| [ 101] [ 101-question ] | [ Symmetric Tree] [ 101-tips ] | [ Easy] [ E ] | [ ✅] [ 101-java ] | | [ ✅] [ 101-kotlin ] |
78
78
| [ 104] [ 104-question ] | [ Maximum Depth of Binary Tree] [ 104-tips ] | [ Easy] [ E ] | [ ✅] [ 104-java ] | | [ ✅] [ 104-kotlin ] |
79
79
| [ 107] [ 107-question ] | [ Binary Tree Level Order Traversal II] [ 107-tips ] | [ Easy] [ E ] | [ ✅] [ 107-java ] | | [ ✅] [ 107-kotlin ] |
378
378
[ 069-js ] : ./src/_069/Solution.js
379
379
[ 070-js ] : ./src/_070/Solution.js
380
380
[ 083-js ] : ./src/_083/Solution.js
381
+ [ 100-js ] : ./src/_100/Solution.js
381
382
[ 226-js ] : ./src/_226/Solution.js
382
383
[ 561-js ] : ./src/_561/Solution.js
383
384
[ 643-js ] : ./src/_643/Solution.js
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Definition for a binary tree node.
3
+ * function TreeNode(val) {
4
+ * this.val = val;
5
+ * this.left = this.right = null;
6
+ * }
7
+ */
8
+ /**
9
+ * @param {TreeNode } p
10
+ * @param {TreeNode } q
11
+ * @return {boolean }
12
+ */
13
+ var isSameTree = function ( p , q ) {
14
+ if ( p == null && q == null ) return true
15
+ if ( p == null || q == null ) return false
16
+ if ( p . val == q . val ) {
17
+ return isSameTree ( p . left , q . left ) && isSameTree ( p . right , q . right )
18
+ }
19
+ return false
20
+ } ;
Original file line number Diff line number Diff line change @@ -83,6 +83,28 @@ class Solution {
83
83
}
84
84
```
85
85
86
+ ``` javascript
87
+ /**
88
+ * Definition for a binary tree node.
89
+ * function TreeNode(val) {
90
+ * this.val = val;
91
+ * this.left = this.right = null;
92
+ * }
93
+ */
94
+ /**
95
+ * @param {TreeNode} p
96
+ * @param {TreeNode} q
97
+ * @return {boolean}
98
+ */
99
+ var isSameTree = function (p , q ) {
100
+ if (p == null && q == null ) return true
101
+ if (p == null || q == null ) return false
102
+ if (p .val == q .val ) {
103
+ return isSameTree (p .left , q .left ) && isSameTree (p .right , q .right )
104
+ }
105
+ return false
106
+ };
107
+ ```
86
108
## 结语
87
109
88
110
如果你同我们一样热爱数据结构、算法、LeetCode,可以关注我们 GitHub 上的 LeetCode 题解:[ LeetCode-Solution] [ ls ]
You can’t perform that action at this time.
0 commit comments