mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-27 21:58:57 +01:00
add short explanation
This commit is contained in:
parent
fba17c66e9
commit
0884b95d4e
1 changed files with 11 additions and 0 deletions
|
@ -30,6 +30,17 @@
|
||||||
# Approach: Using Recursion + Memoization, Top Down Dynamic Programming
|
# Approach: Using Recursion + Memoization, Top Down Dynamic Programming
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Algorithm: Dynamic Programming state transition.
|
||||||
|
#
|
||||||
|
# F(0) = 1
|
||||||
|
# F(n)a = F(n-1)a + F(n-1)e + F(n-1)i + F(n-1)o +F(n-1)u
|
||||||
|
# F(n)e = F(n-1)e + F(n-1)i + F(n-1)o + F(n-1)u
|
||||||
|
# F(n)i = F(n-1)i + F(n-1)o +F(n-1)u
|
||||||
|
# F(n)o = F(n-1)o + F(n-1)u
|
||||||
|
# F(n)u = F(n-1)u
|
||||||
|
#
|
||||||
|
|
||||||
# @param {Integer} n
|
# @param {Integer} n
|
||||||
# @return {Integer}
|
# @return {Integer}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue