In addition to the put and get interfaces, the associated arrays also have some sort-related interfaces. The complete interface for associating arrays is as follows:
Public interface ST
{// Return the smallest Key Value public key min (); // return the public Value get (Key key) corresponding to the Key; // return the closest Value to the key, however, the public key floor (Key) of the key is not greater than the Key; // return the public key select (int n) of the nth small Key ); // return all the public Key [] keys (Key start, Key end) keys from start to end; // return the closest key to the Key, however, the public key ceiling (Key key) of the Key is not smaller than the key; // return the maximum public Key max (); // return the number of keys from start to end public int size (Key start, Key end ); // return the rank of the specified Key in the array public int rank (key Key );}
So far, we have only introduced the binary search method, but the complexity of this insert operation is still N. In the subsequent sections, we will introduce efficient algorithms to make all operations more complex than lg N.