Concept Flow - BST Iterator Design
Initialize stack empty
Push all left nodes from root
Check if stack empty?
Yes→No next element
No
Pop top node from stack
Return popped node's value
Push all left nodes from popped node's right child
↩Back to Check if stack empty?
The iterator uses a stack to store nodes. It pushes all left children from the root initially. On next(), it pops the top node, returns its value, then pushes all left children of the popped node's right child.