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

Black-White Array:一种新的动态数据集数据结构

Black-White Array: A New Data Structure for Dynamic Data Sets

Z. George Mou

摘要:

提出了一种新的基于数组的数据结构--黑白数组(BWA),它可以有效地替代基于列表或树的数据结构,用于动态数据集的数据处理。它由两个子阵列组成,一个是白色的,一个是黑色的,大小是白色的一半。它们都被概念性地划分为不同等级的段,其大小按几何顺序增长。BWA的布局允许容易地计算关于段的元数据,其被广泛地用于动态集合的基本操作的算法中。将无序数序列插入到BWA中所花费的摊销时间与序列长度成对数。我们还证明了当搜索或删除的值存在于BWA中时,操作的渐近摊销成本为O(log(n));否则,时间将落在O(log(n))和O(log^2(n))之间。结果表明,状态变量总,它记录的值的数量在BWA捕捉BWA的状态转移的动态。这一事实被利用来为操作产生简洁、易于理解和有效的编码。由于BWA使用数组作为动态集的底层结构,因此它既不需要空间来存储引用其他数据节点的指针,也不需要像任何链接的数据结构那样花费时间来追踪指针。完成了BWA的C++实现。最后,对实验数据进行了分析,并绘制了相应的曲线图,验证了理论分析的正确性.测试结果表明,在各种条件下,对于大小从210到229的BWA,插入、搜索和删除操作的摊销时间都在105.949到5720.49纳秒之间。

英文摘要:

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.

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

↑