Black-White Array: A New Data Structure for Dynamic Data Sets
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 conceptuall...
Main Author: | |
---|---|
Format: | Text |
Language: | unknown |
Published: |
2020
|
Subjects: | |
Online Access: | http://arxiv.org/abs/2004.09051 |
id |
ftarxivpreprints:oai:arXiv.org:2004.09051 |
---|---|
record_format |
openpolar |
spelling |
ftarxivpreprints:oai:arXiv.org:2004.09051 2023-09-05T13:23:43+02:00 Black-White Array: A New Data Structure for Dynamic Data Sets Mou, Z. George 2020-04-20 http://arxiv.org/abs/2004.09051 unknown http://arxiv.org/abs/2004.09051 Computer Science - Data Structures and Algorithms text 2020 ftarxivpreprints 2023-08-16T15:50:14Z 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. Text The Pointers ArXiv.org (Cornell University Library) |
institution |
Open Polar |
collection |
ArXiv.org (Cornell University Library) |
op_collection_id |
ftarxivpreprints |
language |
unknown |
topic |
Computer Science - Data Structures and Algorithms |
spellingShingle |
Computer Science - Data Structures and Algorithms Mou, Z. George Black-White Array: A New Data Structure for Dynamic Data Sets |
topic_facet |
Computer Science - Data Structures and Algorithms |
description |
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. |
format |
Text |
author |
Mou, Z. George |
author_facet |
Mou, Z. George |
author_sort |
Mou, Z. George |
title |
Black-White Array: A New Data Structure for Dynamic Data Sets |
title_short |
Black-White Array: A New Data Structure for Dynamic Data Sets |
title_full |
Black-White Array: A New Data Structure for Dynamic Data Sets |
title_fullStr |
Black-White Array: A New Data Structure for Dynamic Data Sets |
title_full_unstemmed |
Black-White Array: A New Data Structure for Dynamic Data Sets |
title_sort |
black-white array: a new data structure for dynamic data sets |
publishDate |
2020 |
url |
http://arxiv.org/abs/2004.09051 |
genre |
The Pointers |
genre_facet |
The Pointers |
op_relation |
http://arxiv.org/abs/2004.09051 |
_version_ |
1776204306389663744 |