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

04/20/2020
by   Z. George Mou, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/13/2020

Update Query Time Trade-off for dynamic Suffix Arrays

The Suffix Array SA(S) of a string S[1 ... n] is an array containing all...
research
12/23/2021

Dynamic Suffix Array with Sub-linear update time and Poly-logarithmic Lookup Time

The Suffix Array SA_S[1… n] of an n-length string S is a lexicographical...
research
06/12/2023

RIP Linked List

Linked lists have always been an excellent teaching tool in programming....
research
10/11/2021

Parallel Batched Interpolation Search Tree

Ordered set (and map) is one of the most used data type. In addition to ...
research
11/20/2022

Optimal resizable arrays

A resizable array is an array that can grow and shrink by the addition o...
research
11/01/2017

Fast Dynamic Arrays

We present a highly optimized implementation of tiered vectors, a data s...
research
12/13/2018

Optimal Algorithm for Profiling Dynamic Arrays with Finite Values

How can one quickly answer the most and top popular objects at any time,...

Please sign up or login with your details

Forgot password? Click here to reset