pith. sign in

arxiv: 2101.09700 · v1 · pith:LPMSDZQDnew · submitted 2021-01-24 · 💻 cs.PL

A greedy algorithm for dropping digits (Functional Pearl)

classification 💻 cs.PL
keywords greedyusedalgorithmdigitslinear-timenumberproofpuzzle
0
0 comments X
read the original abstract

Consider the puzzle: given a number, remove $k$ digits such that the resulting number is as large as possible. Various techniques were employed to derive a linear-time solution to the puzzle: predicate logic was used to justify the structure of a greedy algorithm, a dependently-typed proof assistant was used to give a constructive proof of the greedy condition, and equational reasoning was used to calculate the greedy step as well as the final, linear-time optimisation.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.