Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
yaozc
ProjectLeet
Commits
685e0412
Commit
685e0412
authored
Mar 25, 2019
by
yaozc
Browse files
problem 94 solved
parent
1a24a66d
Changes
1
Hide whitespace changes
Inline
Side-by-side
code.cpp
View file @
685e0412
...
...
@@ -136,3 +136,23 @@ bool isValidSudoku(vector<vector<char>>& board) {
}
return
true
;
}
//94. Binary Tree Inorder Traversal
//inorder traversd binary tree, solved by watched the answer
class
Solution
{
public:
vector
<
int
>
inorderTraversal
(
TreeNode
*
root
)
{
if
(
root
){
if
(
root
->
left
){
inorderTraversal
(
root
->
left
);
}
result
.
push_back
(
root
->
val
);
if
(
root
->
right
){
inorderTraversal
(
root
->
right
);
}
}
return
result
;
}
private:
vector
<
int
>
result
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment