Sciweavers

FUN
2010
Springer

O(1)-Time Unsorting by Prefix-Reversals in a Boustrophedon Linked List

13 years 7 months ago
O(1)-Time Unsorting by Prefix-Reversals in a Boustrophedon Linked List
Conventional wisdom suggests that O(k)-time is required to reverse a substring of length k. To reduce this time complexity, a simple and unorthodox data structure is introduced. A boustrophedon linked list is a doubly-linked list, except that each node does not differentiate between its backward and forward pointers. This lack of information allows substrings of any length to be reversed in O(1)-time. This advantage is used to efficiently unsort permutations using prefix-reversals. More specifically, this paper presents two algorithms that visit each successive permutations of n = {1, 2, . . . , n} in worst-case O(1)-time (i.e. loopless). The first visits the permutations using a prefix-reversal Gray code due to Zaks [22], while the second visits the permutations in colexicographic order. As an added challenge, both algorithms are nonprobing since they rearrange the data structure without querying its values. To accomplish this feat, the algorithms are based on two integer sequences: A...
Aaron Williams
Added 02 Sep 2010
Updated 02 Sep 2010
Type Conference
Year 2010
Where FUN
Authors Aaron Williams
Comments (0)