Recursion: Paul Leandro Lanot College Lecturer, Sics
Recursion: Paul Leandro Lanot College Lecturer, Sics
Recursive thinking is really important in programming and it helps you break down big problems into
smaller ones and easier to use
When to choose recursion?
• If you can divine the problem into similar sub problems
• Design an algorithm to compute nth
• Write code to list the n
• Implement a method to compute all.
• Practice
The prominent usage of recursion in data structures like trees and graphs
It is used in many algorithms (divide and conquer, greedy and dynamic programming)
HOW RECURSION WORKS?