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 fb3f95e commit e963491Copy full SHA for e963491
math/factorial_memoization.cpp
@@ -27,6 +27,13 @@
27
28
/// Array to store computed factorials for memoization
29
std::array<uint64_t, 1000> memo{0};
30
+#include <iostream> /// for IO operations
31
+
32
+/**
33
+ * @namespace math
34
+ * @brief Math algorithms
35
+ */
36
+namespace math {
37
38
/**
39
* @brief Computes the factorial of a non-negative integer using recursion and memoization.
@@ -40,6 +47,7 @@ uint64_t fact_recursion(uint64_t n) {
40
47
return memo[n];
41
48
}
42
49
50
+} // namespace math
43
51
44
52
* @brief Self-test implementations for the fact_recursion function.
45
53
* @returns void
0 commit comments