Design an iterator over a binary search tree with the following rules:

- Elements are visited in ascending order (i.e. an in-order traversal)
`next()`

and `hasNext()`

queries run in O(1) time in average.

Example

For the following binary search tree, in-order traversal by using iterator is `[1, 6, 10, 11, 12]`

O(n) space, O(1) has next and next: