Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Computer Science Introduction to Algorithms Recursion and Space Complexity Space Complexity

Logarithmic space referred to as logarithmic time?

Around 5:02 "Because of this, we say that the recursive version of the binary search algorithm runs in logarithmic time with a big O of log N."

Should this be "runs in logarithmic space"?

I think that's what the example is illustrating.

I think he just misspoke, but yeah I noticed the same thing.

2 Answers

Jordan Kittle
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jordan Kittle
Full Stack JavaScript Techdegree Graduate 20,148 Points

I also noticed this. I think it should have been talking about space complexity too. The subject he was talking about was space complexity and the video was showing extra memory requirements at the time.

Hi, as you noticed and learned the time complexity for a recursive binary search is O(log(n)) and its space complexity is also O(log(n)), because you will have to keep log(n) times right, left and array in the computer memory.

Hope this helped!