Concept Flow - BST Iterator Design
Initialize stack empty
Push all left nodes from root
HasNext?
No→End iteration
Yes
Pop top node from stack
Return node value
Push all left nodes from popped node's right child
↩Back to HasNext?
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.