diff options
author | Jack Sangdahl <[email protected]> | 2025-02-03 15:37:19 -0700 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-02-03 15:37:19 -0700 |
commit | 55a67f776dd9acd258cae16ffb636751666b0f40 (patch) | |
tree | 601539de43809b70ceb8228a12c35883fa300b03 /BST_iterator.cpp | |
parent | a0030873dabb517594ae0394350d6715071f7fb8 (diff) | |
download | leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip |
chore: Remove incomplete solutions
Diffstat (limited to 'BST_iterator.cpp')
-rw-r--r-- | BST_iterator.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/BST_iterator.cpp b/BST_iterator.cpp deleted file mode 100644 index e50c74a..0000000 --- a/BST_iterator.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "leetcode.h" - -class BSTIterator { -public: - stack<TreeNode *> s; - BSTIterator(TreeNode *root) { partialOrder(root); } - int next() { - TreeNode *top = s.top(); - s.pop(); - partialOrder(top->right); - return top->val; - } - bool hasNext() { return !s.empty(); } - void partialOrder(TreeNode *root) { - while (root != NULL) { - s.push(root); - root = root->left; - } - } -}; - -int main() {} |