BinarySearch
mdoc.internal.pos.BinarySearch
object BinarySearch
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BinarySearch.type
Members list
Type members
Classlikes
case object Equal extends ComparisonResult
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalstrait ComparisonResultclass Objecttrait Matchableclass AnyShow all
- Self type
-
Equal.type
case object Greater extends ComparisonResult
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalstrait ComparisonResultclass Objecttrait Matchableclass AnyShow all
- Self type
-
Greater.type
case object Smaller extends ComparisonResult
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalstrait ComparisonResultclass Objecttrait Matchableclass AnyShow all
- Self type
-
Smaller.type
Value members
Concrete methods
Binary search using a custom compare function.
Binary search using a custom compare function.
scala.util.Searching does not support the ability to search an IndexedSeq by a custom mapping function, you must search by an element of the same type as the elements of the Seq.
Value parameters
- array
-
Must be sorted according to compare function so that for all i > j, compare(array(i), array(i)) == Greater.
- compare
-
Callback used at every guess index to determine whether the search element has been found, or whether to search above or below the guess index.
Attributes
- Returns
-
The first element where compare(element) == Equal. There is no guarantee which element is chosen if many elements return Equal.
In this article