We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cbbf30 commit 8a683d2Copy full SHA for 8a683d2
math/factorial_memoization.cpp
@@ -1,11 +1,13 @@
1
/**
2
* @file
3
- * @brief [Factorial calculation using recursion and memoization (dynamic programming)](https://en.wikipedia.org/wiki/Factorial)
+ * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization](https://en.wikipedia.org/wiki/Memoization)
4
* @details
5
* This program computes the factorial of a non-negative integer using recursion
6
* with memoization (top-down dynamic programming). It stores intermediate results
7
* to avoid redundant calculations for improved efficiency.
8
*
9
+ * Memoization is a form of caching where the result to an expensive function call
10
+ * is stored and returned.
11
* Example:
12
* Input: n = 5
13
* Output: 120
0 commit comments