Strictly In-Place Algorithms for Permuting and Inverting Permutations

01/11/2021
by   Bartłomiej Dudek, et al.
0

We revisit the problem of permuting an array of length n according to a given permutation in place, that is, using only a small number of bits of extra storage. Fich, Munro and Poblete [FOCS 1990, SICOMP 1995] obtained an elegant 𝒪(nlog n)-time algorithm using only 𝒪(log^2n) bits of extra space for this basic problem by designing a procedure that scans the permutation and outputs exactly one element from each of its cycles. However, in the strict sense in place should be understood as using only an asymptotically optimal 𝒪(log n) bits of extra space, or storing a constant number of indices. The problem of permuting in this version is, in fact, a well-known interview question, with the expected solution being a quadratic-time algorithm. Surprisingly, no faster algorithm seems to be known in the literature. Our first contribution is a strictly in-place generalisation of the method of Fich et al. that works in 𝒪_ε(n^1+ε) time, for any ε > 0. Then, we build on this generalisation to obtain a strictly in-place algorithm for inverting a given permutation on n elements working in the same complexity. This is a significant improvement on a recent result of Guśpiel [arXiv 2019], who designed an 𝒪(n^1.5)-time algorithm.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/07/2019

An in-place, subquadratic algorithm for permutation inversion

We assume the permutation π is given by an n-element array in which the ...
research
11/02/2021

Truly Low-Space Element Distinctness and Subset Sum via Pseudorandom Hash Functions

We consider low-space algorithms for the classic Element Distinctness pr...
research
04/27/2020

In-Place Bijective Burrows-Wheeler Transforms

One of the most well-known variants of the Burrows-Wheeler transform (BW...
research
08/30/2023

Sorting Signed Permutations by Reversals in Nearly-Linear Time

Given a signed permutation on n elements, we need to sort it with the fe...
research
03/30/2020

A Faster Subquadratic Algorithm for the Longest Common Increasing Subsequence Problem

The Longest Common Increasing Subsequence (LCIS) is a variant of the cla...
research
08/14/2019

Re-Pair In-Place

Re-Pair is a grammar compression scheme with favorably good compression ...
research
07/18/2019

Fast permutation-word multiplication and the simultaneous conjugacy problem

Given a finite sequence a_1, a_2,..., a_d of d permutations in the symme...

Please sign up or login with your details

Forgot password? Click here to reset