A fast algorithm for constructing balanced binary search trees

02/07/2019
by   Pavel S. Ruzankin, et al.
0

We suggest a new non-recursive algorithm for constructing a binary search tree given an array of numbers. The algorithm has O(N) time and O(1) memory complexities if the given array of N numbers is sorted. The resulting tree is of minimal height and can be transformed to a complete binary search tree (retaining minimal height) with O( N) time and O(1) memory.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

07/01/2020

A novel algorithm to determine the leaf (leaves) of a binary tree from its preorder and postorder traversals

Binary trees are essential structures in Computer Science. The leaf (lea...
04/27/2018

Average Case Analysis of Leaf-Centric Binary Tree Sources

We study the average size of the minimal directed acyclic graph (DAG) wi...
03/05/2018

Controlled quantum search on structured databases

We present quantum algorithms to search for marked vertices in structure...
04/14/2021

Cost-constrained Minimal Steiner Tree Enumeration by Binary Decision Diagram

The Steiner tree enumeration problem is a well known problem that asks f...
04/18/2018

Independent Distributions on a Multi-Branching AND-OR Tree of Height 2

We investigate an AND-OR tree T and a probability distribution d on the ...
02/07/2020

Recursive PGFs for BSTs and DSTs

We review fundamentals underlying binary search trees and digital search...
05/04/2020

Probabilistic Analysis of RRT Trees

This thesis presents analysis of the properties and run-time of the Rapi...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

References

  • 1. N. Aghaieabiane, H. Koppelaar, P. Nasehpour (2017). An improved algorithm to reconstruct a binary tree from its inorder and postorder traversals. Journal of algorithms and computation. vol. 49, no. 1, pp. 93–113.
  • 2. V. V. Das (2010). A New Non-recursive Algorithm for Reconstructing a Binary Tree from its Traversals. 2010 International Conference on Advances in Recent Technologies in Communication and Computing, Kottayam, pp. 261–263. doi: 10.1109/ARTCom.2010.88
  • 3. Find first set. Wikipedia article. retrieved January 14, 2019. https://en.wikipedia.org/wiki/Find_first_set
  • 4. T. Gagie (2003). New Ways to Construct Binary Search Trees. In: Ibaraki T., Katoh N., Ono H. (eds) Algorithms and Computation. ISAAC 2003. Lecture Notes in Computer Science, vol. 2906, Springer, Berlin, Heidelberg.
  • 5. D. E. Knuth (1973). The art of computer programming: Sorting and searching., vol. 3. Reading, Mass.: Addison-Wesley Pub. Co.
  • 6. Sorted List to complete BST. Rhyscitlema. July 31, 2018. retrieved February 22, 2019. http://rhyscitlema.com/algorithms/sorted-list-to-complete-bst/
  • 7. C. J. Stephenson (1980). A method for constructing binary search trees by making insertions at the root. Int. J. Comput. Inf. Sci. 9, pp. 15–29.
  • 8. J. G. Vaucher (2004). Building optimal binary search trees from sorted values in O(N) time. In: Essays in Memory of Ole-Johan Dahl, pp. 376–388.
  • 9. N. Wirth (1976). Algorithms + data structures = programs. Englewood Cliffs, N.J.: Prentice-Hall.