0 votes 0 votes Stack space used in binary search resursive implementation. Algorithms binary-search algorithms + – vaishali jhalani asked Nov 10, 2016 vaishali jhalani 865 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Prashant. commented Nov 10, 2016 reply Follow Share yes O(logn) recursion call stack space . 3 votes 3 votes vaishali jhalani commented Nov 10, 2016 reply Follow Share If we consider the tail recursion then? 0 votes 0 votes Prashant. commented Nov 10, 2016 reply Follow Share then also , computer think that he have to do some work after function call retuen . so yes he take O(logn) space . do iterative then O(1). 2 votes 2 votes vaishali jhalani commented Nov 10, 2016 reply Follow Share Ok... if in this case we want to minimise the stack space then is it possible in the recursive case ? 0 votes 0 votes Prashant. commented Nov 10, 2016 reply Follow Share See recursive means we have to wait till function call return and call to another function so 1st call have to wait for last call . so no space not minimized . as i think 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes In case of recursive implementation, O(Logn) recursion call stack space. sarveswara rao v answered Nov 10, 2016 sarveswara rao v comment Share Follow See all 0 reply Please log in or register to add a comment.