Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-x24gv Total loading time: 0 Render date: 2024-05-01T07:24:09.637Z Has data issue: false hasContentIssue false

12 - Dynamic Structures

Published online by Cambridge University Press:  05 September 2016

Gonzalo Navarro
Affiliation:
Universidad de Chile
Get access

Summary

Throughout the book we have assumed that our compact data structures are static, that is, we build them once and they do not change anymore; we only support queries on them. In many cases the data are indeed static or change infrequently enough to allow us afford a periodic reconstruction of the data structures from scratch. In other cases, however, the data change frequently and reconstruction is unfeasible. This is the scenario we address in this chapter.

In many data types, supporting updates together with queries is intrinsically harder than the static case. For example, though we have seen that static bitvectors (Chapter 4), sequences (Chapter 6), and trees (Chapter 8) can support many operations in timeO(log log n) or less, those operations require at least time(log n/ log log n)when insertions and deletions of symbols (for bitvectors and sequences) or nodes (for trees) are allowed. In this chapter we will see practical techniques to turn those structures dynamic, with slowdown factors of typically O(w) compared to the base static representation. When n is large, O(w) becomes similar to O(log n).

Dynamism usually allows one to build the data structures within their final compressed space, by successively inserting the elements. In general, however, this construction is significantly slower than the procedures we have seen throughout the book, although the latter typically use more space.

Bitvectors

Consider a bitvector B[1, n], where in addition to the access, rank, and select operations described in Chapter 4, we support the following updates to B:

insert(B, i, b): inserts bit b between B[i − 1] and B[i], for 1 ≤ in + 1.

delete(B, i): deletes B[i], for 1 ≤ in.

We show how to support both the query and the update operations in time O(w) while using n + O(n/w) bits of space, where n is the size of B at the time the operation is carried out. We later consider compression.

The data structure is a classical, pointer-based, balanced search tree T (an AVL or a Red-Black tree, for example), where the leaves point to arrays of bits (these bit arrays have no further structure). Each internal node v contains two fields: v.num and v.ones are the total number of bits and of 1s, respectively, stored at the leaves that descend from the left child of v.

Type
Chapter
Information
Compact Data Structures
A Practical Approach
, pp. 450 - 500
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Arroyuelo, D., Davoodi, P., and Rao, S. S. (2016). Succinct dynamic cardinal trees. In Algorithmica, 74(2), 742–777.Google Scholar
Bentley, J. L. and Saxe, J. B. (1980). Decomposable searching problems I: static-to-dynamic transformation. Journal of Algorithms, 1(4), 301–358.Google Scholar
Blandford, D. and Blelloch, G. (2004). Compact representations of ordered sets. In Proc. 15th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 11–19.Google Scholar
Brisaboa, N. R., de Bernardo, G., and Navarro, G., (2012). Compressed dynamic binary relations. In Proc. 22nd Data Compression Conference (DCC), pages 52–61.Google Scholar
Brodnik, A., Carlsson, S., Demaine, E. D., Munro, J. I., and Sedgewick, R. (1999). Resizable arrays in optimal time and space. In Proc. 6th International Symposium on Algorithms and Data Structures (WADS), LNCS 1663, pages 37–48.Google Scholar
Chan, H.-L., Hon, W.-K., Lam, T.-W., and Sadakane, K. (2007). Compressed indexes for dynamic text collections. ACM Transactions on Algorithms, 3(2), article 21.Google Scholar
Córdova, J. and Navarro, G., (2016). Practical dynamic entropy-compressed bitvectors with applications. In Proc. 15th International Symposium on Experimental Algorithms (SEA), LNCS 9685, pages 105–117.Google Scholar
Demaine, E. D. and Munro, J. I. (1999). Fast allocation and deallocation with an improved buddy system. In Proc. 19th Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS), LNCS 1738, pages 84–96.Google Scholar
Farzan, A. and Munro, J. I. (2011). Succinct representation of dynamic trees. Theoretical Computer Science, 412(24), 2668–2678.Google Scholar
Ferragina, P., and Manzini, G., (2005). Indexing compressed texts. Journal of the ACM, 52(4), 552–581.Google Scholar
Ferragina, P., Manzini, G., Mäkinen, V., and Navarro, G., (2007). Compressed representations of sequences and full-text indexes. ACM Transactions on Algorithms, 3(2), article 20.Google Scholar
Fredman, M. and Saks, M. (1989). The cell probe complexity of dynamic data structures. In Proc. 21st Annual ACM Symposium on Theory of Computing (STOC), pages 345–354.Google Scholar
Gog, S., Navarro, G., and Petri, M. (2015). Improved and extended locating functionality on compressed suffix arrays. Journal of Discrete Algorithms, 32, 53–63.Google Scholar
González, R. and Navarro, G., (2009). Rank/select on dynamic compressed sequences and applications. Theoretical Computer Science, 410, 4414–4422.Google Scholar
Grossi, R., Raman, R., Rao, S. S., and Venturini, R. (2013). Dynamic compressed strings with random access. In Proc. 40th International Colloquium on Automata, Languages and Programming (ICALP), LNCS 7965, pages 504–515.Google Scholar
He, M. and Munro, J. I. (2010). Succinct representations of dynamic strings. In Proc. 17th International Symposium on String Processing and Information Retrieval (SPIRE), LNCS 6393, pages 334–346.Google Scholar
He, M. andMunro, J. I. (2014). Space efficient data structures for dynamic orthogonal range counting. Computational Geometry, 47(2), 268–281.Google Scholar
Hon, W.-K., Sadakane, K., and Sung, W.-K. (2011). Succinct data structures for searchable partial sums with optimal worst-case performance. Theoretical Computer Science, 412(39), 5176–5186.Google Scholar
Jansson, J., Sadakane, K., and Sung, W.-K. (2012). CRAM: Compressed random access memory. In Proc. 39th International Colloquium on Automata, Languages, and Programming (ICALP), LNCS 7391, pages 510–521.Google Scholar
Jansson, J., Sadakane, K., and Sung, W.-K. (2015). Linked dynamic tries with applications to LZcompression in sublinear time and space. Algorithmica, 71(4), 969–988.Google Scholar
Joannou, S. and Raman, R. (2011). An empirical evaluation of extendible arrays. In Proc. 10th International Symposium on Experimental Algorithms (SEA), LNCS 6630, pages 447–458.Google Scholar
Joannou, S. and Raman, R. (2012). Dynamizing succinct tree representations. In Proc. 11th International Symposium on Experimental Algorithms (SEA), LNCS 7276, pages 224–235.Google Scholar
Katajainen, J. (2016). Worst-case-efficient dynamic arrays in practice. In Proc. 15th International Symposium on Experimental Algorithms (SEA), LNCS 9685, pages 167–183.Google Scholar
Klitzke, P. and Nicholson, P. K. (2016). A general framework for dynamic succinct and compressed data structures. In Proc. 18th Workshop on Algorithm Engineering and Experiments (ALENEX), pages 160–173.Google Scholar
Knowlton, K. C. (1965). A fast storage allocator. Communications of the ACM, 8(10), 623–625.Google Scholar
Lee, S. and Park, K. (2009). Dynamic rank/select structures with applications to run-length encoded texts. Theoretical Computer Science, 410(43), 4402–4413.Google Scholar
Mäkinen, V. and Navarro, G., (2008). Dynamic entropy-compressed sequences and full-text indexes. ACM Transactions on Algorithms, 4(3), article 32.Google Scholar
Mauerer, W. (2008). Professional Linux Kernel Architecture. Wrox Press.
Munro, J. I. (1986). An implicit data structure supporting insertion, deletion, and search in time. Journal of Computer and Systems Sciences, 33(1), 66–74.Google Scholar
Munro, J. I. and Nekrich, Y. (2015). Compressed data structures for dynamic sequences. In Proc. 23rd Annual European Symposium on Algorithms (ESA), LNCS 9294, pages 891–902.Google Scholar
Munro, J. I., Nekrich, Y., and Vitter, J. S. (2015). Dynamic data structures for document collections and graphs. In Proc. 34th ACM Symposium on Principles of Database Systems (PODS), pages 277–289.Google Scholar
Navarro, G., and Nekrich, Y. (2014). Optimal dynamic sequence representations. SIAM Journal on Computing, 43(5), 1781–1806.Google Scholar
Navarro, G., and Sadakane, K. (2014). Fully-functional static and dynamic succinct trees. ACMTransactions on Algorithms, 10(3), article 16.Google Scholar
Pătraşcu, M. (2007). Lower bounds for 2-dimensional range counting. In Proc. 39th Annual ACM Symposium on Theory of Computing (STOC), pages 40–46.Google Scholar
Pătraşcu, M. and Demaine, E. D. (2006). Logarithmic lower bounds in the cell-probe model. SIAM. Journal on Computing, 35(4), 932–963.Google Scholar
Raman, R. and Rao, S. S. (2003). Succinct dynamic dictionaries and trees. In Proc. 30th International Colloquium on Automata, Languages and Programming (ICALP), LNCS 2719, pages 357–368.Google Scholar
Raman, R., Raman, V., and Rao, S. S. (2001). Succinct dynamic data structures. In Proc. 3rd International Symposium on Algorithms and Data Structures (WADS), pages 426–437.Google Scholar
Russo, L. M. S., Navarro, G., and Oliveira, A. (2011). Fully-compressed suffix trees. ACM Transactions on Algorithms, 7(4), article 53.Google Scholar

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Dynamic Structures
  • Gonzalo Navarro, Universidad de Chile
  • Book: Compact Data Structures
  • Online publication: 05 September 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316588284.013
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Dynamic Structures
  • Gonzalo Navarro, Universidad de Chile
  • Book: Compact Data Structures
  • Online publication: 05 September 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316588284.013
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Dynamic Structures
  • Gonzalo Navarro, Universidad de Chile
  • Book: Compact Data Structures
  • Online publication: 05 September 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316588284.013
Available formats
×