可逆线性和二分搜索算法的折衷分析
Analyzing Trade-offs in Reversible Linear and Binary Search Algorithms
摘要:
可逆算法是每一步都代表一个部分内射函数的算法;它们对可逆系统的性能优化很有用。在这项研究中,使用Janus,一个可逆的命令式高级程序设计语言,我们已经开发了可逆的线性和二进制搜索算法。我们已经分析了它们之间的非平凡的时空权衡,重点是内存使用忽略原始输入和输出,输出垃圾的大小忽略原始输入,以及输入的最大遍历量。本研究中的程序可以很容易地适用于其他可逆程序设计语言。我们的分析表明,输出数据和/或数据结构的变化会影响有效的可逆算法的设计。例如,输入数据遍历的次数取决于搜索是成功还是失败,而它在相应的不可逆线性和二进制搜索中几乎从不改变。我们的观察表明的重要性,选择的数据结构和什么被视为输出的目的是可逆的算法设计。
英文摘要:
Reversible algorithms are algorithms in which each step represents a partial injective function; they are useful for performance optimization in reversible systems. In this study, using Janus, a reversible imperative high-level programming language, we have developed reversible linear and binary search algorithms. We have analyzed the non-trivial space-time trade-offs between them, focusing on the memory usage disregarding original inputs and outputs, the size of the output garbage disregarding the original inputs, and the maximum amount of traversal of the input. The programs in this study can easily be adapted to other reversible programming languages. Our analysis reveals that the change of the output data and/or the data structure affects the design of efficient reversible algorithms. For example, the number of input data traversals depends on whether the search has succeeded or failed, while it expectedly never changes in corresponding irreversible linear and binary searches. Our observations indicate the importance of the selection of data structures and what is regarded as the output with the aim of the reversible algorithm design.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。