void _End(Node* Proot)
{
Node* cur = Proot;
Node* prev = nullptr;
stack<Node*> s;
while (cur || !s.empty())
{
while (cur)
{
s.push(cur);
cur = cur->left_;
}
Node* top = s.top();
//右树不为空
if (nullptr != top->right_ && prev != top->right_)
cur = top->right_;
//右树为空
else
{
cout << top->val_ << " ";
prev = top;
s.pop();
}
}
cout << endl;
}
07-23
696
10-16
1143
11-16