public class StaticSETofInts extends java.lang.Object
The rank and contains operations take logarithmic time in the worst case.
For additional documentation, see Section 1.2 of Algorithms, 4th Edition, by Robert Sedgewick and Kevin Wayne.
Constructor and Description |
---|
StaticSETofInts(int[] keys)
Creates a set of integers specified by array keys[].
|
public StaticSETofInts(int[] keys)
java.lang.IllegalArgumentException
- if the array contains duplicate integerspublic boolean contains(int key)
public int rank(int key)
key
- the search key