mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-08 19:06:00 +00:00
* 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
8 lines
176 B
JavaScript
8 lines
176 B
JavaScript
/**
|
|
* @param {number} number
|
|
* @return {number}
|
|
*/
|
|
export default function factorialRecursive(number) {
|
|
return number > 1 ? number * factorialRecursive(number - 1) : 1;
|
|
}
|