Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 414 Bytes

File metadata and controls

20 lines (16 loc) · 414 Bytes

Base Case

The general structure of a recursive method is that it will sometimes call itself and sometimes not.

This makes sense if you think about it. If it always called itself, it would never stop calling itself and run forever.

We call the case where the function will not call itself a "base case"

if (<SOMETHING>) {
    <CALL SELF>
}
else {
    // The base case
    return <VALUE>;
}