An Efficient Algorithm for Permutation Iteration Using a Singly Linked List
An Efficient Algorithm for Permutation Iteration Using a Singly Linked List
We present a new algorithm for iterating over all permutations of a sequence. The algorithm leverages elementary $O(1)$ operations on recursive lists. As a result, no new nodes are allocated during the computation. Instead, all elements are rearranged within the original nodes of the singly linked list throughout the process. While permutations are generated in an unusual order, the transitions between consecutive permutations remain smooth. A proof of concept written in the Lisp programming language is proposed and discussed.
Thomas Baruchel
计算技术、计算机技术
Thomas Baruchel.An Efficient Algorithm for Permutation Iteration Using a Singly Linked List[EB/OL].(2025-06-26)[2025-07-16].https://arxiv.org/abs/2501.10102.点此复制
评论