Implementing recursive algorithms
As you might have already guessed, recursion is implemented via nested function calls, as we learned earlier in this course. However, a recursive function calls itself instead of calling some other function. Now that we know about stack frames and stack memory, it is easy to visualize how these recursive function calls work under the hood.
Continuing our atm queue example, let us look at how a recursive function can implement the recursive relation.
C++
Java
Typescript
Javascript
Python
Liking the course? Check our discounted plans to continue learning.