GATE CSE
First time here? Checkout the FAQ!
x
0 votes
122 views
Stack space used in binary search resursive implementation.
asked in Algorithms by Boss (6k points)   | 122 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

+1 vote
In case of recursive implementation, O(Logn) recursion call stack space.
answered by Active (1.3k points)  
Members at the site
Top Users Feb 2017
  1. Arjun

    4676 Points

  2. Bikram

    4004 Points

  3. Habibkhan

    3738 Points

  4. Aboveallplayer

    2966 Points

  5. sriv_shubham

    2278 Points

  6. Smriti012

    2212 Points

  7. Arnabi

    1814 Points

  8. Debashish Deka

    1788 Points

  9. sh!va

    1444 Points

  10. mcjoshi

    1444 Points

Monthly Topper: Rs. 500 gift card

20,788 questions
25,938 answers
59,532 comments
21,923 users