previous | start | next

Ordered Symbol Table Methods

The ordered symbol table has all the same methods as the symbol table with unordered keys (in gray).

The additions to the unordered symbol table are

    public class ST<Key extends Comparable<Key>, Value> {
       
        public void put( Key key,  Value val)  {...}
        public Value get( Key key) {...}
        public void delete( Key key)  {...}
        public boolean contains(Key key) {...}
        public int size() {...}
        public boolean isEmpty() {...}
        public Iterable<Key> keys() {...}       

        public Key min() {...}
        public Key max() {...}
        public void deleteMin() {...}
        public void deleteMax() {...}     
      
        public Key floor( Key key) {...}
        public Key ceiling( Key key) {...}      
      
        public int rank( Key key) {...}
        public Key select( int k) {...}      
    }


previous | start | next