Sorting algorithms/Patience sort: Difference between revisions
Content deleted Content added
Alextretyak (talk | contribs) Added 11l |
Alextretyak (talk | contribs) |
||
Line 16:
I arr.len < 2 {R}
[[
L(el) arr
L(pile) piles
Line 40:
V iArr = [4, 65, 2, -31, 0, 99, 83, 782, 1]
patience_sort(&iArr)
print(iArr)
V cArr = [‘n’, ‘o’, ‘n’, ‘z’, ‘e’, ‘r’, ‘o’, ‘s’, ‘u’, ‘m’]
patience_sort(&cArr)
print(cArr)
V sArr = [‘dog’, ‘cow’, ‘cat’, ‘ape’, ‘ant’, ‘man’, ‘pig’, ‘ass’, ‘gnu’]
patience_sort(&sArr)
print(sArr)</lang>
{{out}}
<pre>
[-31, 0, 1, 2, 4, 65, 83, 99, 782]
[e, m, n, n, o, o, r, s, u, z]
[ant, ape, ass, cat, cow, dog, gnu, man, pig]
</pre>
|