9 list = array[1..max] of integer;
\r
16 procedure quicksort(var a : list; Lo,Hi: integer);
\r
18 procedure sort(l,r : integer);
\r
24 i := l; j := r; x := a[( l+r ) div 2];
\r
26 while a[i] < x do i := i+1;
\r
27 while x < a[j] do j := j-1;
\r
30 y := a[i]; a[i] := a[j]; a[j] := y;
\r
34 if l < j then sort( l , j );
\r
35 if i < r then sort( i , r );
\r
45 write('Now generating 1000 random numbers...');
\r
47 for i := 1 to max do data[i] := random(30000);
\r
49 writeln('Now sorting random numbers...');
\r
51 writeln('Start time is : ',h,' : ',m,' : ',s,' : ',hun);
\r
52 quicksort( data, 1, max );
\r
54 {for i := 1 to max do write(data[i] ); }
\r
56 writeln('Finish time is : ',h,' : ',m,' : ',s,' : ',hun);
\r