Answers are grounded in this paper and cite their sources.
This pearl demonstrates an efficient functional approach to solving the longest increasing subsequence problem, suggesting improvements over traditional imperative methods.
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.
No takes yet. Share an insight, caveat, or question.
Dinges et al. (2025) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: