arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1709.08900cs.DS
收藏

就地可初始化数组

In-Place Initializable Arrays

Takashi Katoh, Keisuke Goto

摘要:

可初始化数组是支持对任何元素进行读写操作以及初始化整个数组的数组。本文提出了一种简单的就地算法,用于在具有$w$位字长的字RAM模型上实现长度为$N$的可初始化阵列,该阵列在$N \ell +1$位中包含$\ell \in O(w)$位条目,即,所提出的阵列在包含$\ell$位条目的长度$N$的正常阵列的顶部仅需要1个额外位。我们的算法支持所有三个操作在恒定的最坏情况下的时间,也就是说,它运行在每个操作过程中使用最多恒定数量的字$O(w)$位的地方。时间和空间复杂度是最佳的,因为已经证明,在恒定的最坏情况时间内,没有额外位支持所有操作的可初始化数组的实现[Hagerup和Kammer,ISAAC 2017]。我们的算法显著改进了早期研究[Navarro,CSUR 2014]中提出的最佳算法,该算法使用$N + o(N)$额外位来支持恒定最差情况时间内的所有操作。

英文摘要:

An initializable array is an array that supports the read and write operations for any element and the initialization of the entire array. This paper proposes a simple in-place algorithm to implement an initializable array of length $N$ containing $\ell \in O(w)$ bits entries in $N \ell +1$ bits on the word RAM model with $w$ bits word size, i.e., the proposed array requires only 1 extra bit on top of a normal array of length $N$ containing $\ell$ bits entries. Our algorithm supports the all three operations in constant worst-case time, that is, it runs in-place using at most constant number of words $O(w)$ bits during each operation. The time and space complexities are optimal since it was already proven that there is no implementation of an initializable array with no extra bit supporting all the operations in constant worst-case time [Hagerup and Kammer, ISAAC 2017]. Our algorithm significantly improves upon the best algorithm presented in the earlier studies [Navarro, CSUR 2014] which uses $N + o(N)$ extra bits to support all the operations in constant worst-case time.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑