A set of recursion problems to be solved (solutions included).
The goal is to work under the directory /problems
. Implement a solution to get the test(s) to pass. You can find solutions under /solutions
.
What on Earth is Recursion? - Computerphile
It is important to identify the base case(s). Base cases tell a recursive function when to stop, preventing recursive functions from calling itself infinitely.
Double check base cases if you encouter this error in the test output:
RangeError: Maximum call stack size exceeded
- Install npm dependencies
yarn
- Run tests for problems
yarn test
or to run the tests for the solutions
yarn test:solutions
- 01 - sumArray
- 02 - max
- 03 - factorial
- 04 - exponent
- 05 - isPalindrome
- 06 - range
- 07 - reverseString
- 08 - getElementsByClassname
- 09 - fibonacci
- 10 - gcd
- 11 - binarySearch
- 12 - mergesort
- 13 - quicksort
- 14 - stringPermutations
PRs welcomed! Just submit a PR with a note (new recursion problem? better performance? readibility? bug fix? better testing?)