0 votes 0 votes DS data-structures time-complexity binary-search-tree + – gshivam63 asked May 19, 2016 • recategorized Jul 6, 2022 by Lakshman Bhaiya gshivam63 421 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 1 votes 1 votes Worst case time to search an element in balanced BST with n element =log2n Here we have (2n)! element So time complexity will be=log2 (2n)! =log22n2n =2n log22n =2n(log22 +log2n) =2nlog2n = O(nlogn) ManojK answered May 19, 2016 • selected May 19, 2016 by gshivam63 ManojK comment Share Follow See all 3 Comments See all 3 3 Comments reply gshivam63 commented May 19, 2016 reply Follow Share How log2(2n)!=log22n2n 0 votes 0 votes rameshbabu commented May 19, 2016 reply Follow Share for upper bound we can assume, n! = n^n 0 votes 0 votes ManojK commented May 19, 2016 reply Follow Share log(2n!)=log(2n*2n-1*............2*1) <=log2n2n =O(nlogn) 0 votes 0 votes Please log in or register to add a comment.