2009-06-25 02:29:33 +00:00
|
|
|
BEGIN {
|
2011-08-15 03:07:31 +00:00
|
|
|
recurse1 = QSEAWK " -vQSEAWK=" QSEAWK " -vSCRIPT_PATH=" SCRIPT_PATH " -f " SCRIPT_PATH "/quicksort2.awk #" rand()
|
|
|
|
recurse2 = QSEAWK " -vQSEAWK=" QSEAWK " -vSCRIPT_PATH=" SCRIPT_PATH " -f " SCRIPT_PATH "/quicksort2.awk #" rand()
|
2009-06-25 02:29:33 +00:00
|
|
|
}
|
|
|
|
NR == 1 {
|
|
|
|
pivot=$0;
|
|
|
|
next
|
|
|
|
}
|
|
|
|
NR > 1 { if($0 < pivot) { print | recurse1 }
|
|
|
|
if($0 > pivot) { print | recurse2 }
|
|
|
|
}
|
|
|
|
END {
|
|
|
|
close(recurse1)
|
|
|
|
if(NR > 0) print pivot
|
|
|
|
close(recurse2)
|
|
|
|
}
|
|
|
|
|