Matrix chain multiplication: Difference between revisions
m
Regularize non-standard header markup
No edit summary |
Thundergnat (talk | contribs) m (Regularize non-standard header markup) |
||
Line 747:
</pre>
==
{{trans|Fortran}}
Line 804:
"(1*((((((2*3)*4)*(((5*6)*7)*8))*9)*10)*11))"</lang>
==
<lang lua>-- Matrix A[i] has dimension dims[i-1] x dims[i] for i = 1..n
local function MatrixChainOrder(dims)
Line 982:
</pre>
==
We will solve the task in three steps:
Line 1,187:
</pre>
==
'''Memoization'''
Line 1,373:
</pre>
==
=== Recursive solution ===
{{trans|Python}}
|