Definition at line 27 of file factorial_memoization.cpp.
◆ operator()()
std::uint64_t MemorisedFactorial::operator() |
( |
std::uint64_t | n | ) |
|
|
inline |
- Note
- This function was intentionally written as recursive and it does not handle overflows.
- Returns
- factorial of n
Definition at line 36 of file factorial_memoization.cpp.
36 {
37 if (n >= this->known_values.size()) {
38 this->known_values.push_back(n * this->operator()(n - 1));
39 }
40 return this->known_values.at(n);
41 }
◆ known_values
std::vector<std::uint64_t> MemorisedFactorial::known_values = {1} |
|
private |
The documentation for this class was generated from the following file: