The keys method has to return a reference to some object that has a method:
Iterator<Key> iterator()
The Iterator<Key> that this iterator() method returns should allow the keys to be returned, one at a time and in sorted order, using the next() method.
The Queue<E> class implements Iterable<E> [Queue has an Iterator<E> iterator() method].
So one implementation of keys() would be to
- Create an empty Queue<Key>
- Insert the keys from BST into this Queue in order.
- return the Queue