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

Please sign up or login with your details

Forgot password? Click here to reset