一组要解决的递归问题(包括解决方案)
一组要解决的递归问题(包括解决方案)
JavaScript 学习教程
共31Star
详细介绍
Recursion Joy
A set of recursion problems to be solved (solutions included).
Getting Started
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
Quick Start
- Install npm dependencies
yarn
- Run tests for problems
yarn test
or to run the tests for the solutions
yarn test:solutions
Problems
- 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
Contributing
PRs welcomed! Just submit a PR with a note (new recursion problem? better performance? readibility? bug fix? better testing?)
-
13839 Star
-
247 Star
-
5 Star
-
5 Star
-
1536 Star
-
2424 Star
-
2 Star
-
279 Star
-
0 Star