Longest increasing subsequence: Difference between revisions
Content added Content deleted
m (→{{header|Perl 6}}: adding "Perl 6" in the subsection titles) |
m (Swapped D versions) |
||
Line 65: | Line 65: | ||
(0 2 6 9 11 15)</pre> |
(0 2 6 9 11 15)</pre> |
||
=={{header|D}}== |
=={{header|D}}== |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
===Patience sorting=== |
===Patience sorting=== |
||
{{trans|Python}} |
{{trans|Python}} |
||
Line 106: | Line 128: | ||
d.writeln; |
d.writeln; |
||
}</lang> |
}</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
===Faster Version=== |
===Faster Version=== |
||
Line 162: | Line 182: | ||
[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]]) |
[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]]) |
||
d.writeln; |
d.writeln; |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}</lang> |
}</lang> |
||
The output is the same. |
The output is the same. |