Abstract

k-ary trees are a fundamental data structure in many text-processing algorithms (e.g., text searching). The traditional pointer-based representation of trees is space consuming, and hence only relatively small trees can be kept in main memory. Nowadays, however, many applications need to store a huge amount of information. In this paper we present a succinct representation for dynamic k-ary trees of n nodes, requiring 2n + nlogk + o(nlogk) bits of space, which is close to the information-theoretic lower bound. Unlike alternative representations where the operations on the tree can be usually computed in O(logn) time, our data structure is able to take advantage of asymptotically smaller values of k, supporting the basic operations parent and child in O(logk + loglogn) time, which is o(logn) time whenever logk = o(logn). Insertions and deletions of leaves in the tree are supported in \(O((\log{k}+\log\log{n})(1+\frac{\log{k}}{\log{(\log{k} + \log\log{n})}}))\) amortized time. Our representation also supports more specialized operations (like subtreesize, depth, etc.), and provides a new trade-off when k = O(1) allowing faster updates (in O(loglogn) amortized time, versus the amortized time of O((loglogn)1 + ε ), for ε> 0, from Raman and Rao [21]), at the cost of slower basic operations (in O(loglogn) time, versus O(1) time of [21]).

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.