lsvtec
GNU/Linux Evangelist
1. I need an algorithm that given a sorted array builds a binary search tree with height O(lg n ) and has a run time of O( n ).
2. I need an algorithm that given 2 BST's with height n1 and n2 respectively, will concatinate them into 1 tree with height O( lg( n1 + n2 ) ) and has a run-time of O( n1 + n2 ).
Anybody?
2. I need an algorithm that given 2 BST's with height n1 and n2 respectively, will concatinate them into 1 tree with height O( lg( n1 + n2 ) ) and has a run-time of O( n1 + n2 ).
Anybody?