math/factorial_memoization.cpp
Node1
-
-math/factorial_memoization.cpp
+
+math/factorial_memoization.cpp
@@ -21,8 +21,8 @@
Node2
-
-iostream
+
+cassert
@@ -30,8 +30,8 @@
Node1->Node2
-
-
+
+
@@ -39,8 +39,8 @@
Node3
-
-cassert
+
+cstdint
@@ -48,8 +48,8 @@
Node1->Node3
-
-
+
+
@@ -57,8 +57,8 @@
Node4
-
-array
+
+vector
@@ -66,26 +66,8 @@
Node1->Node4
-
-
-
-
-
-
-
-Node5
-
-
-cstdint
-
-
-
-
-
-Node1->Node5
-
-
-
+
+
diff --git a/db/d3b/class_memorised_factorial-members.html b/db/d3b/class_memorised_factorial-members.html
new file mode 100644
index 000000000..b9739585f
--- /dev/null
+++ b/db/d3b/class_memorised_factorial-members.html
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+TheAlgorithms/C++: Member List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TheAlgorithms/C++ 1.0.0
+
+ All the algorithms implemented in C++
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
This is the complete list of members for MemorisedFactorial , including all inherited members.
+
+
+
+
+
+
+
diff --git a/dd/d47/namespacemath.html b/dd/d47/namespacemath.html
index 4c23c781e..4251ef948 100644
--- a/dd/d47/namespacemath.html
+++ b/dd/d47/namespacemath.html
@@ -174,8 +174,6 @@ Functions
Function to calculate Euler's Totient.
uint64_t factorial (uint8_t n)
function to find factorial of given number
-uint64_t fact_recursion (uint64_t n)
- Computes the factorial of a non-negative integer using recursion and memoization.
double integral_approx (double lb, double ub, const std::function< double(double)> &func, double delta=.0001)
Computes integral approximation.
void test_eval (double approx, double expected, double threshold)
@@ -247,8 +245,8 @@ Functions
std::cout
for IO implementations
Evaluate recurrence relation using matrix exponentiation .
-for mathematical functions
Math algorithms.
+for mathematical functions
Mathematical algorithms.
for IO operations
for M_PI definition and pow()
@@ -821,42 +819,6 @@ template<typename T>
-
-◆ fact_recursion()
-
-
-
-
-
- uint64_t math::fact_recursion
- (
- uint64_t n )
-
-
-
-
-
-
Computes the factorial of a non-negative integer using recursion and memoization.
-
Parameters
-
- n The integer whose factorial is to be computed
-
-
-
-
Returns The factorial of n
-
-
Definition at line 44 of file factorial_memoization.cpp .
-
44 {
-
45 if (n == 0) return 1;
-
-
-
-
49 }
-
std::array< uint64_t, 1000 > memo
Array to store computed factorials for memoization.
-
uint64_t fact_recursion(uint64_t n)
Computes the factorial of a non-negative integer using recursion and memoization.
-
-
-
◆ factorial()
diff --git a/dd/d47/namespacemath.js b/dd/d47/namespacemath.js
index d81337f4b..617f04a36 100644
--- a/dd/d47/namespacemath.js
+++ b/dd/d47/namespacemath.js
@@ -14,7 +14,6 @@ var namespacemath =
[ "cylinder_surface_area", "dd/d47/namespacemath.html#ac5803413618fcfb922cb32c6db0fc864", null ],
[ "cylinder_surface_perimeter", "dd/d47/namespacemath.html#a1d4df7a4e43a2eac1acc0ac610487c73", null ],
[ "cylinder_volume", "dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca", null ],
- [ "fact_recursion", "dd/d47/namespacemath.html#a73b07abea036f1ce2e3ac5dc169bdb4b", null ],
[ "factorial", "dd/d47/namespacemath.html#a7e78996673df791014cfe540b183456a", null ],
[ "hemi_sphere_surface_area", "dd/d47/namespacemath.html#a3277e65a8f380e7632791975bfba0efb", null ],
[ "integral_approx", "dd/d47/namespacemath.html#aec65db4e5c7317323227f026fe50ef11", null ],
diff --git a/doxygen_crawl.html b/doxygen_crawl.html
index 7eac40139..784caa13c 100644
--- a/doxygen_crawl.html
+++ b/doxygen_crawl.html
@@ -486,8 +486,6 @@
-
-
@@ -2100,6 +2098,8 @@
+
+
@@ -2345,6 +2345,7 @@
+
@@ -2842,7 +2843,6 @@
-
diff --git a/functions_func_o.html b/functions_func_o.html
index b05db2449..156c28070 100644
--- a/functions_func_o.html
+++ b/functions_func_o.html
@@ -128,7 +128,7 @@ $(function(){initNavTree('functions_func_o.html','',''); });
operator&() : uint128_t , uint256_t
operator&&() : uint128_t , uint256_t
operator&=() : uint128_t , uint256_t
-operator()() : Compare< S, T, E > , uint128_t , uint256_t
+operator()() : Compare< S, T, E > , MemorisedFactorial , uint128_t , uint256_t
operator*() : Complex , divide_and_conquer::strassens_multiplication::Matrix< T, typename > , uint128_t , uint256_t
operator*=() : divide_and_conquer::strassens_multiplication::Matrix< T, typename > , large_number , uint128_t , uint256_t
operator+() : Complex , divide_and_conquer::strassens_multiplication::Matrix< T, typename > , uint128_t , uint256_t
diff --git a/functions_o.html b/functions_o.html
index dc01d4109..2f94aa2b1 100644
--- a/functions_o.html
+++ b/functions_o.html
@@ -128,7 +128,7 @@ $(function(){initNavTree('functions_o.html','',''); });
operator&() : uint128_t , uint256_t
operator&&() : uint128_t , uint256_t
operator&=() : uint128_t , uint256_t
-operator()() : Compare< S, T, E > , uint128_t , uint256_t
+operator()() : Compare< S, T, E > , MemorisedFactorial , uint128_t , uint256_t
operator*() : Complex , divide_and_conquer::strassens_multiplication::Matrix< T, typename > , uint128_t , uint256_t
operator*=() : divide_and_conquer::strassens_multiplication::Matrix< T, typename > , large_number , uint128_t , uint256_t
operator+() : Complex , divide_and_conquer::strassens_multiplication::Matrix< T, typename > , large_number , uint128_t , uint256_t
diff --git a/globals_func_t.html b/globals_func_t.html
index 059a31509..90f9192c8 100644
--- a/globals_func_t.html
+++ b/globals_func_t.html
@@ -139,7 +139,6 @@ $(function(){initNavTree('globals_func_t.html','',''); });
test_contains() : binary_search_tree2.cpp
test_double() : quick_sort_3.cpp
test_f() : shell_sort2.cpp
-test_fact_recursion() : factorial_memoization.cpp
test_find_max() : binary_search_tree2.cpp
test_find_min() : binary_search_tree2.cpp
test_function() : realtime_stats.cpp
diff --git a/globals_m.html b/globals_m.html
index 9a1c79679..00e78e671 100644
--- a/globals_m.html
+++ b/globals_m.html
@@ -125,7 +125,6 @@ $(function(){initNavTree('globals_m.html','',''); });
MAX_ITERATIONS : bisection_method.cpp , newton_raphson_method.cpp
max_size : queue_using_array.cpp
max_subarray_sum() : kadanes3.cpp
-memo : factorial_memoization.cpp
merge() : merge_sort.cpp
mergeSort() : merge_sort.cpp
method1() : decimal_to_binary.cpp
diff --git a/globals_t.html b/globals_t.html
index 6f5a5069d..438ee1c4e 100644
--- a/globals_t.html
+++ b/globals_t.html
@@ -139,7 +139,6 @@ $(function(){initNavTree('globals_t.html','',''); });
test_contains() : binary_search_tree2.cpp
test_double() : quick_sort_3.cpp
test_f() : shell_sort2.cpp
-test_fact_recursion() : factorial_memoization.cpp
test_find_max() : binary_search_tree2.cpp
test_find_min() : binary_search_tree2.cpp
test_function() : realtime_stats.cpp
diff --git a/globals_vars.html b/globals_vars.html
index 07aab7e8f..40dddd94d 100644
--- a/globals_vars.html
+++ b/globals_vars.html
@@ -130,7 +130,6 @@ $(function(){initNavTree('globals_vars.html','',''); });
MAX_ITER : adaline_learning.cpp
MAX_ITERATIONS : newton_raphson_method.cpp
max_size : queue_using_array.cpp
-memo : factorial_memoization.cpp
prime : primes_up_to_billion.cpp
prime_numbers : prime_factorization.cpp
stack : paranthesis_matching.cpp
diff --git a/hierarchy.html b/hierarchy.html
index 931eb6ff8..a717e4289 100644
--- a/hierarchy.html
+++ b/hierarchy.html
@@ -191,80 +191,81 @@ This inheritance list is sorted roughly, but not completely, alphabetically: C others::Cache::LRUCache< K, V > LRUCache
C others::lru_cache::LRUCache LRU cache class
C divide_and_conquer::strassens_multiplication::Matrix< T, typename > Matrix class
- C MinHeap
- C MinHeapNode
- C mst
- C math::ncr_modulo_p::NCRModuloP Class which contains all methods required for calculating nCr mod p
- C machine_learning::neural_network::NeuralNetwork
- C data_structures::linked_list::Node
- C data_structures::Node
- C data_structures::tree_234::Node 2-3-4 tree node class
- C data_structures::trie_using_hashmap::Trie::Node Struct representing a trie node
- C Node< ValueType >
- C operations_on_datastructures::circular_linked_list::Node A Node struct that represents a single Node in a Binary Tree
- C operations_on_datastructures::inorder_traversal_of_bst::Node A Node structure representing a single node in BST
- C operations_on_datastructures::reverse_binary_tree::Node A Node struct that represents a single node in a Binary Tree
- C others::iterative_tree_traversals::Node Defines the structure of a node of the tree
- C others::recursive_tree_traversals::Node The structure to hold Nodes of the tree
- C range_queries::perSegTree::Node
- C search::sublist_search::Node A Node structure representing a single link Node in a linked list
- C tests::Node A Node struct that represents a single Node in a Binary Tree
- C node
- C strings::boyer_moore::pattern A structure representing all the data we need to search the preprocessed pattern in text
- C range_queries::perSegTree Range query here is range sum, but the code can be modified to make different queries like range max or min
- C ciphers::elliptic_curve_key_exchange::Point Definition of struct Point
- C geometry::grahamscan::Point
- C geometry::jarvis::Point
- C Point
- C priority_queue< T > STL class
- C query
- C Queue
- C queue< ValueType >
- C data_structures::queue_using_array::Queue_Array Queue_Array class containing the main data and also index of head and tail of the array
- C RBtree
- C unordered_set< K >::reverse_iterator STL iterator class
- C vector< T >::reverse_iterator STL iterator class
- C SegmentIntersection
- C data_structures::SegmentTree< T > Class representation of the segment tree
- C range_queries::heavy_light_decomposition::SG< X > Segment Tree , to store heavy chains
- C range_queries::heavy_light_decomposition::HLD< X > The Heavy-Light Decomposition class
- C SJF< S, T, E > Class which implements the SJF scheduling algorithm
- C data_structures::SkipList
- C Solution
- C data_structures::sparse_table::Sparse_table
- C data_structures::Stack< T > Class representation of a stack
- C data_structures::stack_using_queue::Stack Stack Class implementation for basic methods of Stack Data Structure
- C others::postfix_expression::Stack Creates an array to be used as stack for storing values
- C stack< ValueType > For std::invalid_argument
- C stack_linkedList
- C statistics::stats_computer1< T >
- C stats_computer1< T >
- C statistics::stats_computer2< T >
- C stats_computer2< T >
- C TestCase Single example inputs and expected output of the function longest_common_string_length
- C TestCases Class encapsulating the necessary test cases
- C operations_on_datastructures::trie_operations::Tnode Class defining the structure of trie node and containing the methods to perform operations on them
- C tower
- C data_structures::treap::Treap Struct representation of the treap
- C range_queries::heavy_light_decomposition::Tree< X > A Basic Tree , which supports binary lifting
- C range_queries::heavy_light_decomposition::HLD< X > The Heavy-Light Decomposition class
- C data_structures::tree_234::Tree234 2-3-4 tree class
- C data_structures::trie_using_hashmap::Trie Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t(UTF-16)type with methods to insert, delete, search, start with and to recommend words based on a given prefix
- C Trie
- C data_structures::trie Trie implementation for small-case English alphabets a-z
- C Trie::TrieNode
- C std::true_type
- C std::is_arithmetic< uint128_t >
- C std::is_arithmetic< uint256_t >
- C std::is_integral< uint128_t >
- C std::is_integral< uint256_t >
- C std::is_unsigned< uint128_t >
- C std::is_unsigned< uint256_t >
- C uint128_t Class for 128-bit unsigned integer
- C uint256_t Class for 256-bit unsigned integer
- C unordered_set< K > STL class
- C vector< T > STL class
- C probability::windowed_median::WindowedMedian A class to calculate the median of a leading sliding window at the back of a stream of integer values
+ C MemorisedFactorial
+ C MinHeap
+ C MinHeapNode
+ C mst
+ C math::ncr_modulo_p::NCRModuloP Class which contains all methods required for calculating nCr mod p
+ C machine_learning::neural_network::NeuralNetwork
+ C data_structures::linked_list::Node
+ C data_structures::Node
+ C data_structures::tree_234::Node 2-3-4 tree node class
+ C data_structures::trie_using_hashmap::Trie::Node Struct representing a trie node
+ C Node< ValueType >
+ C operations_on_datastructures::circular_linked_list::Node A Node struct that represents a single Node in a Binary Tree
+ C operations_on_datastructures::inorder_traversal_of_bst::Node A Node structure representing a single node in BST
+ C operations_on_datastructures::reverse_binary_tree::Node A Node struct that represents a single node in a Binary Tree
+ C others::iterative_tree_traversals::Node Defines the structure of a node of the tree
+ C others::recursive_tree_traversals::Node The structure to hold Nodes of the tree
+ C range_queries::perSegTree::Node
+ C search::sublist_search::Node A Node structure representing a single link Node in a linked list
+ C tests::Node A Node struct that represents a single Node in a Binary Tree
+ C node
+ C strings::boyer_moore::pattern A structure representing all the data we need to search the preprocessed pattern in text
+ C range_queries::perSegTree Range query here is range sum, but the code can be modified to make different queries like range max or min
+ C ciphers::elliptic_curve_key_exchange::Point Definition of struct Point
+ C geometry::grahamscan::Point
+ C geometry::jarvis::Point
+ C Point
+ C priority_queue< T > STL class
+ C query
+ C Queue
+ C queue< ValueType >
+ C data_structures::queue_using_array::Queue_Array Queue_Array class containing the main data and also index of head and tail of the array
+ C RBtree
+ C unordered_set< K >::reverse_iterator STL iterator class
+ C vector< T >::reverse_iterator STL iterator class
+ C SegmentIntersection
+ C data_structures::SegmentTree< T > Class representation of the segment tree
+ C range_queries::heavy_light_decomposition::SG< X > Segment Tree , to store heavy chains
+ C range_queries::heavy_light_decomposition::HLD< X > The Heavy-Light Decomposition class
+ C SJF< S, T, E > Class which implements the SJF scheduling algorithm
+ C data_structures::SkipList
+ C Solution
+ C data_structures::sparse_table::Sparse_table
+ C data_structures::Stack< T > Class representation of a stack
+ C data_structures::stack_using_queue::Stack Stack Class implementation for basic methods of Stack Data Structure
+ C others::postfix_expression::Stack Creates an array to be used as stack for storing values
+ C stack< ValueType > For std::invalid_argument
+ C stack_linkedList
+ C statistics::stats_computer1< T >
+ C stats_computer1< T >
+ C statistics::stats_computer2< T >
+ C stats_computer2< T >
+ C TestCase Single example inputs and expected output of the function longest_common_string_length
+ C TestCases Class encapsulating the necessary test cases
+ C operations_on_datastructures::trie_operations::Tnode Class defining the structure of trie node and containing the methods to perform operations on them
+ C tower
+ C data_structures::treap::Treap Struct representation of the treap
+ C range_queries::heavy_light_decomposition::Tree< X > A Basic Tree , which supports binary lifting
+ C range_queries::heavy_light_decomposition::HLD< X > The Heavy-Light Decomposition class
+ C data_structures::tree_234::Tree234 2-3-4 tree class
+ C data_structures::trie_using_hashmap::Trie Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t(UTF-16)type with methods to insert, delete, search, start with and to recommend words based on a given prefix
+ C Trie
+ C data_structures::trie Trie implementation for small-case English alphabets a-z
+ C Trie::TrieNode
+ C std::true_type
+ C std::is_arithmetic< uint128_t >
+ C std::is_arithmetic< uint256_t >
+ C std::is_integral< uint128_t >
+ C std::is_integral< uint256_t >
+ C std::is_unsigned< uint128_t >
+ C std::is_unsigned< uint256_t >
+ C uint128_t Class for 128-bit unsigned integer
+ C uint256_t Class for 256-bit unsigned integer
+ C unordered_set< K > STL class
+ C vector< T > STL class
+ C probability::windowed_median::WindowedMedian A class to calculate the median of a leading sliding window at the back of a stream of integer values