mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2026-02-02 18:39:09 +08:00
更新代码块
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
中序遍历代码如下:(详细注释)
|
||||
|
||||
```C++
|
||||
```CPP
|
||||
class Solution {
|
||||
public:
|
||||
vector<int> inorderTraversal(TreeNode* root) {
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
迭代法前序遍历代码如下: (**注意此时我们和中序遍历相比仅仅改变了两行代码的顺序**)
|
||||
|
||||
```C++
|
||||
```CPP
|
||||
class Solution {
|
||||
public:
|
||||
vector<int> preorderTraversal(TreeNode* root) {
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
|
||||
后续遍历代码如下: (**注意此时我们和中序遍历相比仅仅改变了两行代码的顺序**)
|
||||
|
||||
```C++
|
||||
```CPP
|
||||
class Solution {
|
||||
public:
|
||||
vector<int> postorderTraversal(TreeNode* root) {
|
||||
|
||||
Reference in New Issue
Block a user