javascript-algorithms/src/algorithms/math/factorial
m-maksyutin c5ed81d85e Add recursive factorial function (#85)
* Fix LinkedList

* Fix the prepend method for the LinkedList

* Fix the remove method for the MinHeap

* Correct a comment

* Fix BST removal method

* Fix the findEdge method of the graph

* Fix the value returned by DisjointSet union

* Add recursive factorial function
2018-06-28 21:03:31 +03:00
..
__test__ Add recursive factorial function (#85) 2018-06-28 21:03:31 +03:00
factorial.js Do minor optimisations to factorial function. 2018-06-02 09:40:32 +03:00
factorialRecursive.js Add recursive factorial function (#85) 2018-06-28 21:03:31 +03:00
README.md Add factorial. 2018-04-18 13:05:07 +03:00

Factorial

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example:

5! = 5 * 4 * 3 * 2 * 1 = 120
n n!
0 1
1 1
2 2
3 6
4 24
5 120
6 720
7 5 040
8 40 320
9 362 880
10 3 628 800
11 39 916 800
12 479 001 600
13 6 227 020 800
14 87 178 291 200
15 1 307 674 368 000

References

Wikipedia