Skip to content

Commit ada7183

Browse files
committed
Chapter 06 section 03 C++ codes updated.
1 parent b002dcd commit ada7183

File tree

1 file changed

+8
-6
lines changed
  • 06-Stack-and-Queue/Course Code (C++)/03-Non-Recursive-Implementation-of-a-Recursive-Algorithm

1 file changed

+8
-6
lines changed

06-Stack-and-Queue/Course Code (C++)/03-Non-Recursive-Implementation-of-a-Recursive-Algorithm/main3.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ struct TreeNode {
1616
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
1717
};
1818

19-
struct Command{
20-
string s; // go, print
21-
TreeNode* node;
22-
Command(string s, TreeNode* node): s(s), node(node){}
23-
};
24-
2519
class Solution {
20+
21+
private:
22+
struct Command{
23+
string s; // go, print
24+
TreeNode* node;
25+
Command(string s, TreeNode* node): s(s), node(node){}
26+
};
27+
2628
public:
2729
vector<int> postorderTraversal(TreeNode* root) {
2830

0 commit comments

Comments
 (0)