Skip to content

Commit 98f22f3

Browse files
authored
Update binary-search-tree-iterator-ii.cpp
1 parent d3d836e commit 98f22f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/binary-search-tree-iterator-ii.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class BSTIterator {
2424

2525
int next() {
2626
if (++pos_ == size(vals_)) {
27-
TreeNode *curr = stk_.back(); stk_.pop_back();
28-
traverseLeft(curr->right);
29-
vals_.emplace_back(curr->val);
27+
TreeNode *node = stk_.back(); stk_.pop_back();
28+
traverseLeft(node->right);
29+
vals_.emplace_back(node->val);
3030
}
3131
return vals_[pos_];
3232
}

0 commit comments

Comments
 (0)