/Recursion-Problems

This repository contains few frequently asked questions on recursion during placements.

Primary LanguagePython

Recursion-Problems

This repository contains few frequently asked coding problems on recursion during placements.



What is Recursion?



The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function. Using recursive algorithm, certain problems can be solved quite easily. Examples of such problems are Towers of Hanoi (TOH), Inorder/Preorder/Postorder Tree Traversals, DFS of Graph, etc.


All recursive algorithms must obey three IMPORTANT laws:



  • A RECURSIVE algorithm must call itself, RECURSIVELY.

  • A RECURSIVE algorithm must have a base case.

  • A RECURSIVE algorithm must change its state and move toward the base case.