Introduction
Recursion is an approach to solving problems using a function that calls itself as a subroutine
It reduces the given problem into subproblems
The recursion call continues until it reaches a point where the subproblem can be solved without further recursion
Recursive function have to have the following two properties:
A simple base case — a terminating scenario
A set of rules, a.k.a. recurrence relation that reduces all other cases towards the base case
You Will Know
topic1
Why Should You Learn These
Contents
Click
cmd/ctrl
+
option/alt
+
T
to expand all toggles
1. Recursion Function
2. Reverse String
3. Swap Nodes in Pairs
Conclusions
References
Further Readings
https://www.secmem.org/blog/2021/07/09/recursion/
https://sagnibak.github.io/blog/python-is-haskell-tail-recursion/
https://chrispenner.ca/posts/python-tail-recursion