Paper record
W1998790567Permuting in Place
Faith Ellen Fich, J. Ian Munro, Patricio V. Poblete
- Year
- 1995
- Venue
- SIAM Journal on Computing
- References
- 9
- Cited by
- 43
Details and counts from OpenAlex.
Abstract
This paper addresses the fundamental problem of permuting the elements of an array of n elements according to some given permutation. It aims to perform the permutation quickly by using only a polylogarithmic number of bits of extra storage. The main result is an algorithm whose worst case running time is and uses additional -bit words of memory. A simpler method is presented for the case in which both the permutation and its inverse can be computed at (amortised) unit cost. This algorithm requires time and words in the worst case. These results are extended to the situation in which a power of the permutation must be applied. A linear time, word method is presented for the special case in which the data values are all distinct and are either initially in sorted order or will be when permuted.