DOI: 10.1145/3828706 ISSN: 2475-1421
A Catenable, Splittable, Transient Sequence Data Structure
Arthur Charguéraud, François Pottier
A transient data structure is a combination of an ephemeral data structure, a persistent data structure, and fast conversions between them. We present a transient sequence data structure that supports efficient read and write access at an arbitrary index with worst-case time complexity
O
(
K
log
K
n
), pushing and popping at either end with complexity
O
(
K
log
K
n
), and splitting and concatenation with complexity
O
(
K
log
K
n
+log
K
2
n
), where
K
is a user-defined chunk size and
n
is the length of the sequence. We provide a detailed analysis of this data structure and show that, in many favorable scenarios, it performs much better than these pessimistic bounds might suggest. Furthermore, we describe its implementation, and provide a synthetic benchmark to evaluate the performance of
push
and
pop
. We believe that it is a good candidate for a one-size-fits-all, general-purpose sequence data structure.