Data Structures, Algorithms, & Applications in Java
Chapter 15, Exercise 5
AbstractDataType DIndexedBSTree
{
instances
same as for IndexedBSTree except that the keys need not be distinct
operations
get(k): return any element with key k
get(index): return the indexth element
put(k,x): put element x with key k into the search tree
remove(k): remove any element with key k and return it
remove(index): remove the indexth element and return it
ascend(): output all elements in nondecreasing order of key
}
We may use either the interface IndexedBSTree
or define a new interface that extends
IndexedBSTree, but contains no new methods.
The new interface is given below.
public interface DIndexedBSTree extends IndexedBSTree
{}