Reference. Binary search—think positive
Cite
Cited by (1)
Truly Functional Solutions to the Longest Uptrend Problem (Functional Pearl) dinges-2025-truly
Solutions to the longest increasing subsequence problem are typically implemented imperatively, relying on arrays for constant-time lookups and updates. Replacing these arrays with functional sequences allows a purely functional solution with the same asymptotic running time, but with significantly worse practical performance. In this pearl, we present a purely functional approach that is not only asymptotically optimal, but also efficient in practice. The core idea is to exploit the interplay between search, lookup, and update operations through Huet’s zipper. In addition, we improve the adaptive behaviour of imperative solutions commonly found in the literature.
Cites 5 works (0 here)
External (5)
- Extra, extra — read all about it: Nearly all binary searches and mergesorts are broken (2006)
- Programming: The Derivation of Algorithms (1990)
- Introduction to Functional Programming (1988)
- Why numbering should start at zero (1982)
- The Art of Computer Programming, Volume 3: Sorting and Searching (1973)