/Recursion

Explanation of the recursive algorithms with examples and exercises

Primary LanguageJavaScriptMIT LicenseMIT

Recursion

Recursion is doing the same thing over again. Recursion, is doing the same thing over again. In some cases it is repeating the same action of a mathematical formula. However it is much more than that. It can enable you to travese down a tree by returning values through a call stack. You can iterate through data from an AJAX call to create repeated web components.

Regardless of the application, thinking of yourself as the thing that is recursing can help. You are the function and you need information to complete the task that you have. You are always asking the yourself the question: "What do I want to return?". We will make use of this frame of thinking and look into helpful patterns to demistify the magic of recursive algorithms.

In this repo you will find modules corresponding to different archetypes of recursive algorithms. Each contains an explanation of the type of recursion to be implemented. The skeleton of a function and test cases for that function are provided for you to practice the topics discussed. Running npm test in each module will run the code in the file corresponding to the name of the directory. There is a sequence to the modules, but each can be run individually as well.

  1. Mathmatical Recursion

  2. Boolean Seeking Recursion

  3. Iterative Recursion

  4. Accumulating Recursion

A talk associated with the repository will be given on Wendesday May 24 at 6:00 pm. This talk will explain the call stack in more depth and show how to draw stack diagrams in order to visually represent recursion in action. A video of the talk will be linked once it has been given. Here is the link to the event page: Nail Your Technical Interview: Recursion