Debian Codegraph @

examples/demo_quicksort

raw
1 #!/usr/bin/env runawk
2
3 #use "quicksort.awk"
4
5 # This demo sorts the input lines as strings and outputs them to stdout
6
7 # Input files for this demo: examples/demo_quicksort.in
8
9 {
10 array [++count] = $0
11 }
12
13 END {
14 quicksort(array, remap, 1, count)
15
16 for (i=1; i <= count; ++i){
17 print array [remap [i]]
18 }
19 }