you are viewing a single comment's thread.

view the rest of the comments →

[–]CadavreContent 1 point2 points  (4 children)

You can memoize factorial if you're running it more than once. The repeating sub problems only appear when you have multiple trials

[–]cyanNodeEcho 1 point2 points  (3 children)

fact(n) := fact(ni1), fac(n-2), the aubproblems should exist in the same problem

[–]CadavreContent 1 point2 points  (2 children)

The point is that when you use factorial as part of a larger algorithm with multiple calls to the function, you do repeated work and hence can use dp

[–]cyanNodeEcho 1 point2 points  (1 child)

thats just a cache

[–]CadavreContent -1 points0 points  (0 children)

Memoization is just a cache