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

8 lines
176 B
JavaScript

/**
* @param {number} number
* @return {number}
*/
export default function factorialRecursive(number) {
return number > 1 ? number * factorialRecursive(number - 1) : 1;
}