Lesson 9 of 24
Recursion
10 min 30 XP
Recursion में function खुद को छोटे input पर तब तक call करता है जब तक base case उसे रोक न दे। Tower of Hanoi क्लासिक उदाहरण है: n disks के लिए 2ⁿ - 1 moves चाहिए।
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.