计算机科学 > 程序设计语言
[提交于 2021年1月24日]
标题:A greedy algorithm for dropping digits (Functional Pearl)
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Shin-Cheng Mu[v1] 2021年1月24日 星期日 12:20:59 UTC