Binary search tree iterator

0
Remix

Implement an iterator over a binary search tree that returns the values in ascending order with next() and has_next(). Each call should take amortised O(1) time, and memory should be O(height).

MetaCodingLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.