Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to Algorithms!
You have completed Introduction to Algorithms!
Preview
In the last video we wrote a version of binary search that uses a concept called recursion. Recursion might be a new concept for you so let's formalize how we use it.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
we wrote a version of binary search
that uses a concept called Recursion.
0:00
Recursion might be a new concept for you.
0:01
So let's formalize how we use it.
0:04
A recursive function is
one that calls itself.
0:06
In our example the recursive binary search
function called itself inside the body
0:11
of the function.
0:16
When writing a recursive function you
always need a stopping condition.
0:17
And typically we start the body of
the recursive function with this stopping
0:22
condition.
0:27
It's common to call this
stopping condition the base case.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up