Binary search: Difference between revisions

m
(→‎{{header|Haskell}}: Added an encoding of the iterative algorithm in terms of 'until')
Line 2,109:
The iterative algorithm could be written in terms of the '''until''' function, which takes a predicate '''p''', a function '''f''', and a seed value '''x'''.
 
It returns the result of applying '''f''' until '''p''' holds.
 
<lang haskell>import Data.Array (Array, Ix, (!), listArray, bounds)
9,659

edits