@[inline]
def
Array.binSearch
{α : Type}
(as : Array α)
(k : α)
(lt : α → α → Bool)
(lo : Nat := 0)
(hi : Nat := as.size - 1)
:
Option α
Equations
- as.binSearch k lt lo hi = if lo < as.size then let hi := if hi < as.size then hi else as.size - 1; Array.binSearchAux lt id as k lo hi else none
Instances For
@[inline]
Equations
- Array.binInsert lt as k = (Array.binInsertM lt (fun (x : α) => k) (fun (x : Unit) => k) as k).run