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...

Full description

Bibliographic Details
Main Author: Mou, Z. George
Format: Article in Journal/Newspaper
Language:unknown
Published: arXiv 2020
Subjects:
Online Access:https://dx.doi.org/10.48550/arxiv.2004.09051
https://arxiv.org/abs/2004.09051
id ftdatacite:10.48550/arxiv.2004.09051
record_format openpolar
spelling ftdatacite:10.48550/arxiv.2004.09051 2023-05-15T18:32:40+02:00 Black-White Array: A New Data Structure for Dynamic Data Sets Mou, Z. George 2020 https://dx.doi.org/10.48550/arxiv.2004.09051 https://arxiv.org/abs/2004.09051 unknown arXiv arXiv.org perpetual, non-exclusive license http://arxiv.org/licenses/nonexclusive-distrib/1.0/ Data Structures and Algorithms cs.DS FOS Computer and information sciences Article CreativeWork article Preprint 2020 ftdatacite https://doi.org/10.48550/arxiv.2004.09051 2022-03-10T15:48:39Z 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. Article in Journal/Newspaper The Pointers DataCite Metadata Store (German National Library of Science and Technology)
institution Open Polar
collection DataCite Metadata Store (German National Library of Science and Technology)
op_collection_id ftdatacite
language unknown
topic Data Structures and Algorithms cs.DS
FOS Computer and information sciences
spellingShingle Data Structures and Algorithms cs.DS
FOS Computer and information sciences
Mou, Z. George
Black-White Array: A New Data Structure for Dynamic Data Sets
topic_facet Data Structures and Algorithms cs.DS
FOS Computer and information sciences
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 Article in Journal/Newspaper
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
publisher arXiv
publishDate 2020
url https://dx.doi.org/10.48550/arxiv.2004.09051
https://arxiv.org/abs/2004.09051
genre The Pointers
genre_facet The Pointers
op_rights arXiv.org perpetual, non-exclusive license
http://arxiv.org/licenses/nonexclusive-distrib/1.0/
op_doi https://doi.org/10.48550/arxiv.2004.09051
_version_ 1766216858734690304