Iterative Inorder Traversal
Time complexity: O(n).
Auxiliary space: O(h), where h is tree height.
The explicit stack simulates the recursive call stack.
For a BST, the resulting list is sorted.
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.