public class BinarySearch extends Object
The rank operations takes logarithmic time in the worst case.
For additional documentation, see Section 1.1 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
public static int rank(int key,
int[] a)
key - the search keya - the array of integers, must be sorted in ascending orderpublic static void main(String[] args)
Copyright © 2014. All Rights Reserved.