Abstract
We consider a data-structural problem motivated by version control of a hierarchical directory structure in a system like Subversion. The model is that directories and files can be moved and copied between two arbitrary versions in addition to being added or removed in an arbitrary version. Equivalently, we wish to maintain a confluently persistent trie (where internal nodes represent directories, leaves represent files, and edge labels represent path names), subject to copying a subtree between two arbitrary versions, adding a new child to an existing node, and deleting an existing subtree in an arbitrary version.
Our first data structure represents an n-node degree-Δ trie with O(1) “fingers” in each version while supporting finger movement (navigation) and modifications near the fingers (including subtree copy) in \(O(\lg \Delta)\) time and space per operation. This data structure is essentially a locality-sensitive version of the standard practice—path copying—costing \(O(d \lg \Delta)\) time and space for modification of a node at depth d, which is expensive when performing many deep but nearby updates. Our second data structure supporting finger movement in \(O(\lg \Delta)\) time and no space, while modifications take \(O(\lg n)\) time and space. This data structure is substantially faster for deep updates, i.e., unbalanced tries. Both of these data structures are functional, which is a stronger property than confluent persistence. Without this stronger property, we show how both data structures can be sped up to support movement in \(O(\lg \lg \Delta)\), which is essentially optimal. Along the way, we present a general technique for global rebuilding of fully persistent data structures, which is nontrivial because amortization and persistence do not usually mix. In particular, this technique improves the best previous result for fully persistent arrays and obtains the first efficient fully persistent hash table.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Bent, S.W., Sleator, D.D., Tarjan, R.E.: Biased search trees. SIAM J. Comput. 14(3), 545–568 (1985)
Douceur, J.R., Bolosky, W.J.: A large-scale study of file-system contents. SIGMETRICS Perform. Eval. Rev. 27(1), 59–70 (1999)
Dietz, P.F.: Fully persistent arrays. In: Dehne, F., Santoro, N., Sack, J.-R. (eds.) WADS 1989. LNCS, vol. 382, pp. 67–74. Springer, Heidelberg (1989)
Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. J. Comput. Syst. Sci. 38(1), 86–124 (1989)
Driscoll, J.R., Sleator, D.D.K., Tarjan, R.E.: Fully persistent lists with catenation. J. ACM 41(5), 943–959 (1994)
Fiat, A., Kaplan, H.: Making data structures confluently persistent. J. Algorithms 48(1), 16–58 (2003)
Kaplan, H., Tarjan, R.E.: Persistent lists with catenation via recursive slow-down. In: STOC 1995, pp. 93–102 (1995)
Mitzenmacher, M.: Dynamic models for file sizes and double Pareto distributions. Internet Math. 1(3), 305–333 (2003)
Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)
Ports, D.R.K., Clements, A.T., Demaine, E.D.: PersiFS: A versioned file system with an efficient representation. In: SoSP (2005)
Pippenger, N.: Pure versus impure lisp. ACM Trans. Program. Lang. Syst. 19(2), 223–238 (1997)
Pǎtraşcu, M., Thorup, M.: Randomization does not help searching predecessors. In: SODA 2007, pp. 555–564 (2007)
Sleator, D.D., Tarjan, R.E.: A data structure for dynamic trees. J. Comput. Syst. Sci. 26(3), 362–391 (1983)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Demaine, E.D., Langerman, S., Price, E. (2008). Confluently Persistent Tries for Efficient Version Control. In: Gudmundsson, J. (eds) Algorithm Theory – SWAT 2008. SWAT 2008. Lecture Notes in Computer Science, vol 5124. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69903-3_16
Download citation
DOI: https://doi.org/10.1007/978-3-540-69903-3_16
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69900-2
Online ISBN: 978-3-540-69903-3
eBook Packages: Computer ScienceComputer Science (R0)