Understanding a Recursive Problem
In this lesson, we will go over methods to help you visualize a recursive function.
We'll cover the following...
We'll cover the following...
Understanding the Problem
In the previous lessons, we learned the basic concept of recursion and its uses. Now, we will discuss how recursion works.
Let’s take a look at an example code:
On first glance, we notice that the targetNumber is decreased by and printPattern() is being called again. However, there are two print() statements preceding and succeeding the recursive call.
Code Explanation
We want to print a pattern: ...