4 Various sorting algorithms.
9 =========== ===============================================
11 Makefile Automate building and cleanup.
12 data.py Generate random data for the 'data' file.
13 scaling.py Script to generate time-scaling data.
14 main.c Command line framework for a sorting algorithm.
15 sort.h Header declaring sort function syntax.
16 bubble.c Bubble sort implementation of sort.h.
17 quicksort.c Quicksort implementation of sort.h.
18 =========== ===============================================
27 which also builds a random data file 'data'. To build with the DEBUG
28 macro defined (to enable some stderr printouts in main.c), run
32 Remove auto-generated files with
45 Timing 8191 data points on my 571 MHz netbook with
47 $ time ./bubble data > /dev/null
48 $ time ./quicksort data > /dev/null
50 quicksort takes 0.075 s and bubble takes 3.994 s.
52 On ordered data bubble does much better
54 $ time ./bubble ordered-data > /dev/null
55 $ time ./quicksort ordered-data > /dev/null
57 quicksort takes 0.048 s and bubble takes 0.046 s.
59 You can generate scaling graphs for all executables built by the
64 which generates `*-scaling.dat` and `*-scaling.png` for each