Class Search


  • public class Search
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Search()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int binarySearch​(long[] elems, boolean lessThan, long n)
      Binary search an array of numbers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Search

        public Search()
    • Method Detail

      • binarySearch

        public static int binarySearch​(long[] elems,
                                       boolean lessThan,
                                       long n)
        Binary search an array of numbers. The parameter lessThan determines which index is returned: true - index of element less-than-or-equal to our search false - .. greater-than-or-equal ..