A Single Traversal Algorithm for Serializing any Binary Tree
Keywords:Binary Tree, Tree Traversal, Data Compression, Binary Tree Linearization
It is possible to save a binary tree to a file and restore it at a later time. Because these two operations are frequently necessary and therefore important, an efficient algorithm to represent a binary tree in a compact way is very desirable. For special types of binary trees, there are efficient algorithms, otherwise, there is a method that stores both the inorder and either preorder traversal or postorder traversal of the binary tree which requires two traversals of the binary tree during construction of the storage array. In this paper, I present an approach for which only one traversal is sufficient for construction of the storage array.Â I also present a more efficient complement algorithm for restoration of the binary tree.
V. V. Muniswamy, Advanced Data Structures and Algorithms in C++, Mumbai: Jaico Publishing House, 2009.
G. Jacobson, "Space-efficient static trees and graphs.," in 30th IEEE Symposium, 1989.
How to Cite
- Papers must be submitted on the understanding that they have not been published elsewhere (except in the form of an abstract or as part of a published lecture, review, or thesis) and are not currently under consideration by another journal published by any other publisher.
- It is also the authors responsibility to ensure that the articles emanating from a particular source are submitted with the necessary approval.
- The authors warrant that the paper is original and that he/she is the author of the paper, except for material that is clearly identified as to its original source, with permission notices from the copyright owners where required.
- The authors ensure that all the references carefully and they are accurate in the text as well as in the list of references (and vice versa).
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Attribution-NonCommercial 4.0 International that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).
- The journal/publisher is not responsible for subsequent uses of the work. It is the author's responsibility to bring an infringement action if so desired by the author.