Some data structures may require quite complicated logic for iterating over their elements. In this task, you are given a binary search tree to implement the TreeIterator<E> interface which has two methods: boolean hasNext() and E next() which. Create an implementation of TreeIterator that iterates over the elements of BinarySearchTree in ascending order. Also, implement the corresponding TreeIterator<T> iterator() methdod.
The in-order traversal of a binary search tree ensures that its nodes are visited in ascending order.