Searching

object Searching
class Object
trait Matchable
class Any

Value members

Concrete methods

final
def minimalElements[A](as: Iterable[A])(implicit ev: PartialOrder[A]): Seq[A]

Computes the minimal elements of a partially ordered set. If the poset contains multiple copies of a minimal element, the function will only return a single copy of it.

Computes the minimal elements of a partially ordered set. If the poset contains multiple copies of a minimal element, the function will only return a single copy of it.

Works by constructing the set of minimal elements for the first k elements of the poset, for k = 1 .. length.

With n is the size of the poset and w <= n its width, the algorithm requires O(w) space and O(w*n) time.

final
def search[@specialized A : Order](as: Array[A], item: A): Int

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

final
def search[@specialized A : Order](as: Array[A], item: A, lower: Int, upper: Int): Int

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

final
def search[@specialized A : Order](as: IndexedSeq[A], item: A): Int

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

final
def search[@specialized A : Order](as: IndexedSeq[A], item: A, lower: Int, upper: Int): Int

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.

Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch.