Matrix chain multiplication: Difference between revisions
m
→{{header|Perl 6}}: Formatting, marked incomplete
SqrtNegInf (talk | contribs) (Added Perl example) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Formatting, marked incomplete) |
||
Line 591:
(A1((((((A2A3)A4)(((A5A6)A7)A8))A9)A10)A11))</pre>
==
{{incomplete|Perl 6|Does not show computed cost}}
<lang perl6># Reference:
# "Find the optimal way to multiply a chain of matrices. " was the first tasks at
Line 678 ⟶ 680:
}</lang>
{{Out}}
<pre>
./mcm3.p6
1, 5, 25, 30, 100, 70, 2, 1, 100, 250, 1, 1000, 2
((((((((A1A2)A3)A4)A5)A6)A7)(A8(A9A10)))(A11A12))
</
<pre>
./mcm3.p6
1000, 1, 500, 12, 1, 700, 2500, 3, 2, 5, 14, 10
(A1((((((A2A3)A4)(((A5A6)A7)A8))A9)A10)A11))
</
== {{header|Python}} ==
|