Sorting algorithms/Quicksort: Difference between revisions
→{{header|UnixPipes}}: slightly more parallel and hence faster
(→{{header|UnixPipes}}: slightly more parallel and hence faster) |
|||
Line 442:
=={{header|UnixPipes}}==
{{works with|Zsh}}
(a race condition seems to happen in bash when using cat -s instead of using the sequential print)
split() {
(pivot=$1; lc=$2; gc=$3;
Line 452 ⟶ 454:
lc="1.$1" ; gc="2.$1"
read pivot; test -n "$pivot" && (
split $pivot >(
cat -s <(cat -s $lc
)
rm -f $lc $gc;
|