In-situ associative permuting (1301.2046v1)
Abstract: The technique of in-situ associative permuting is introduced which is an association of in-situ permuting and in-situ inverting. It is suitable for associatively permutable permutations of {1,2,...,n} where the elements that will be inverted are negative and stored in order relative to each other according to their absolute values. Let K[1...n] be an array of n integer keys each in the range [1,n], and it is allowed to modify the keys in the range [-n,n]. If the integer keys are rearranged such that one of each distinct key having the value i is moved to the i'th position of K, then the resulting arrangement (will be denoted by KP) can be transformed in-situ into associatively permutable permutation piP using only logn additional bits. The associatively permutable permutation piP not only stores the ranks of the keys of KP but also uniquely represents KP. Restoring the keys from piP is not considered. However, in-situ associative permuting piP in O(n) time using logn additional bits rearranges the elements of piP in order, as well as lets to restore the keys of KP in O(n) further time using the inverses of the negative ranks. This means that an array of n integer keys each in the range [1,n] can be sorted using only logn bits of additional space.