Array

public extension Array where Element: SearchElement

Available where Element: SearchElement

  • Performs a binary search on the array to find the element matching the given value.

    Declaration

    Swift

    func doBinarySearch(_ value: Double) -> SearchElement?

    Parameters

    value

    The value to be matched in the searching process.

    Return Value

    The matching searching element if found, otherwise nil.