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 $\mathcal{O}(n\log n)$-time algorithm using only $\mathcal{O}(\log^{2}n)$ 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 $\mathcal{O}(\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 $\mathcal{O}_{\varepsilon}(n^{1+\varepsilon})$ time, for any $\varepsilon > 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\'spiel [arXiv 2019], who designed an $\mathcal{O}(n^{1.5})$-time algorithm.


翻译:我们重新审视了一个问题, 即根据特定的变换, 即仅使用少量的额外存储位数, 来调整一个长度为$n的阵列。 Fich, Munro 和 Poblete [FOCS 1990, SICOMP 1995] 获得了一个优雅的$mathcal{O} (n\log nn) 美元- 时间算法, 仅使用 $\ mathcal{O} (\log%2}n) 来计算这个基本问题。 通过设计一个程序, 扫描每个周期的变换和输出完全一个元素。 然而, 从严格意义上说, 所选的严格意义上说, 只能使用 asmptotototal 最优化的 $\ mathcal{O} (log nn) 额外空间的一小段, 或者存储一个固定数量的指数。 事实上, 这个版本的调试问题, 其预期的答案是一个四重时间算法。 令人惊讶的是, 在文献中, 似乎没有更快的算法是知道。 我们的第一个贡献在 $xl_ ral ral_ ral_ rol_ a cal rox_ a lax_ a lax a crow rocal rocal rox_ a rocal lausl_ a lax_ lax_ lax_ a cal_ a cal_ maxxxxx_ maxxxxx_ max

0
下载
关闭预览

相关内容

最新《高级算法》Advanced Algorithms,176页pdf
专知会员服务
90+阅读 · 2020年10月22日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
专知会员服务
158+阅读 · 2020年1月16日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
动物脑的好奇心和强化学习的好奇心
CreateAMind
10+阅读 · 2019年1月26日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
Ray RLlib: Scalable 降龙十八掌
CreateAMind
8+阅读 · 2018年12月28日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
已删除
将门创投
3+阅读 · 2018年3月13日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Arxiv
3+阅读 · 2018年10月18日
VIP会员
相关VIP内容
相关资讯
动物脑的好奇心和强化学习的好奇心
CreateAMind
10+阅读 · 2019年1月26日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
Ray RLlib: Scalable 降龙十八掌
CreateAMind
8+阅读 · 2018年12月28日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
已删除
将门创投
3+阅读 · 2018年3月13日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Top
微信扫码咨询专知VIP会员