Abstract

We observe that a standard transformation between ordinal trees (arbitrary rooted trees with ordered children) and binary trees leads to interesting succinct binary tree representations. There are four symmetric versions of these transformations. Via these transformations we get four succinct representations of n-node binary trees that use \(2n + n/(\log n)^{\Theta (1)}\) bits and support (among other operations) navigation, inorder numbering, one of preorder or postorder numbering, subtree size and lowest common ancestor queries. While this functionality, and more, is also supported in O(1) time using \(2n + o(n)\) bits by Davoodi et al. (Phil Trans R Soc A 372:20130131, 2014) extension of a representation by Farzan and Munro (Algorithmica 6), their redundancy, or the o(n) term, is much larger, and their approach may not be suitable for practical implementations. One of these transformations is related to the Zaks’ sequence (Theor Comput Sci 10:63–82, 1980) for encoding binary trees, and we thus provide the first succinct binary tree representation based on Zaks’ sequence. The ability to support inorder numbering is crucial for the well-known range-minimum query problem on an array A of n ordered values. Another of these transformations is equivalent to Fischer and Heun’s (SIAM J Comput 40(2):465–492, 2011) 2d-Min-Heap structure for this problem. Yet another variant allows an encoding of the Cartesian tree of A to be constructed from A using only \(O(\sqrt{n} \log n)\) bits of working space.

Highlights

  • Binary trees are ubiquitous in computer science, and are integral to many applications that involve indexing very large text collections

  • A succinct binary tree representation can usually be divided into two parts: a tree encoding, which gives the structure of the tree, and takes close to 2n bits, and an index of o(n) bits which is used to perform operations on the given tree encoding

  • The earliest succinct binary tree representation was due to Jacobson [15], but this only supported a level-order numbering, and while it supported basic navigational operations such as moving to a parent, left child or right child in O(1) time, it did not support operations such as lowest common ancestor (LCA) and reporting the size of the subtree rooted at a given node, in O(1) time (it still remains unknown if there is a o(n)-bit index to support these operations in Jacobson’s encoding)

Read more

Summary

Introduction

Binary trees are ubiquitous in computer science, and are integral to many applications that involve indexing very large text collections. Since Farzan and Munro [6] showed how to represent binary trees in 2n + o(n) bits and support LCA queries in O(1) time, it would appear that there is a fast and highly space-efficient solution to the RMQ problem. The resulting binary tree representations support a number of operations including basic navigation, subtree size and LCA in O(1) time; the latter implies in particular that they are suitable for the RMQ problem. This encoding can be augmented with additional data structures of size o(n) bits, using only o(n) bits of working space, thereby “improving” the result of [8] where n + o(n) working space is used (the accounting of space is slightly different)

Preliminaries
Succinct Binary Trees Via Ordinal Trees
Transformations
Effect of Transformations on Orderings
Effect of Transformations on Ordinal Tree Encodings
Succinct Binary Tree Representations

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.