论文标题
黑白阵列:动态数据集的新数据结构
Black-White Array: A New Data Structure for Dynamic Data Sets
论文作者
论文摘要
引入了一个名为黑白阵列(BWA)的新的基于数组的数据结构,作为动态数据集的列表或基于树的数据结构的有效替代方法。它由两个子阵列,一个白色的一半的白色和一个黑色组成。它们俩在概念上分为不同等级的段,而大小在几何序列中生长。 BWA的布局允许轻松计算有关段的元数据,这些段用于在动态集的基本操作的算法中广泛使用。将一系列无序数插入BWA中的序列将摊销时间对数达到序列的长度。还证明,当BWA中存在搜索或已删除的值时,操作的渐近摊销成本为O(log(n));否则,时间将介于O(log(n))和O(log^2(n))之间。结果表明,状态变量总数记录了BWA中值的数量,可捕获BWA状态过渡的动力学。该事实被利用以制作简洁,易于理解和有效的操作编码。由于它使用数组作为动态集的基础结构,因此BWA不需要存储引用其他数据节点的指针,也不需要像任何链接的数据结构那样追逐指针的时间。 BWA的C ++实现已完成。收集并绘制了绩效数据,这证实了理论分析。测试结果表明,在各种条件下,插入,搜索和删除操作的摊销时间均在105.949和5720.49纳米秒之间,尺寸为210至229。
A new array based data structure named black-white array (BWA) is introduced as an effective and efficient alternative to the list or tree based data structures for dynamic data set. It consists of two sub-arrays, one white and one black of half of the size of the white. Both of them are conceptually partitioned into segments of different ranks with the sizes grow in geometric sequence. The layout of BWA allows easy calculation of the meta-data about the segments, which are used extensively in the algorithms for the basic operations of the dynamic sets. The insertion of a sequence of unordered numbers into BWA takes amortized time logarithmic to the length of the sequence. It is also proven that when the searched or deleted value is present in the BWA, the asymptotic amortized cost for the operations is O(log(n)); otherwise, the time will fall somewhere between O(log(n)) and O(log^2(n)). It is shown that the state variable total, which records the number of values in the BWA captures the dynamics of state transition of BWA. This fact is exploited to produce concise, easy- to-understand, and efficient coding for the operations. As it uses arrays as the underlying structure for dynamic set, a BWA need neither the space to store the pointers referencing other data nodes nor the time to chase the pointers as with any linked data structures. A C++ implementation of the BWA is completed. The performance data were gathered and plotted, which confirmed the theoretic analysis. The testing results showed that the amortized time for the insert, search, and delete operations is all just between 105.949 and 5720.49 nanoseconds for BWAs of sizes ranging from 210 to 229 under various conditions.