add: 0100
This commit is contained in:
parent
e28411d091
commit
9e7354fc5c
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* Definition for a binary tree node.
|
||||
*/
|
||||
struct TreeNode {
|
||||
int val;
|
||||
TreeNode* left;
|
||||
TreeNode* right;
|
||||
explicit TreeNode(int x = 0, TreeNode* left = nullptr, TreeNode* right = nullptr) : val(x), left(left), right(right) {}
|
||||
};
|
||||
|
||||
class Solution {
|
||||
public:
|
||||
static bool isSameTree(TreeNode* p, TreeNode* q) {
|
||||
return (p == q) || (p && q && p->val == q->val && isSameTree(p->left, q->left) && isSameTree(p->right, q->right));
|
||||
}
|
||||
};
|
||||
|
|
@ -3,4 +3,4 @@ PROJECT(more)
|
|||
|
||||
SET(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
ADD_EXECUTABLE(more 0015.cpp)
|
||||
ADD_EXECUTABLE(more 0100.cpp)
|
||||
|
|
|
|||
Loading…
Reference in New Issue