GATE CSE
First time here? Checkout the FAQ!
x
0 votes
181 views
Stack space used in binary search resursive implementation.
asked in Algorithms by Boss (6.1k points)   | 181 views
yes O(logn) recursion call stack space .
If we consider the tail recursion then?
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).
Ok... if in this case we want to minimise the stack space then is it possible in the recursive case ?
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

1 Answer

+2 votes
In case of recursive implementation, O(Logn) recursion call stack space.
answered by Active (1.4k points)  


Top Users Jul 2017
  1. Bikram

    4386 Points

  2. manu00x

    2464 Points

  3. Debashish Deka

    1850 Points

  4. joshi_nitish

    1686 Points

  5. Arjun

    1340 Points

  6. Hemant Parihar

    1184 Points

  7. Arnab Bhadra

    1112 Points

  8. Shubhanshu

    1080 Points

  9. Ahwan

    900 Points

  10. rahul sharma 5

    732 Points


24,031 questions
30,983 answers
70,430 comments
29,358 users