Plotting Timing Results for MergeSort and QuickSort

mergeTimes is a file produced by running TimingMergeSort. Below, it is imported into Mathematica and assigned to a variable called mt.

mt =  <<  mergeTimes

The list of values in mt is plotted. It is hard to tell that this plot is not for a linear function.

ListPlot[mt,  PlotJoined -> True]

In the commands below, the times for bubble sort are imported into Mathematica and plotted. The quadratic growth of the running time is clear, though something strange seems to happen at the end.

bt = << bubbleTimes

ListPlot[bt,  PlotJoined -> True]

There is a way in Mathematica to plot multiple functions in the same plot. This is shown below. The timings for merge sort have virtually dissapeared because they are so close to the x-axis, compared to the timings for bubble sort.

<< Graphics`MultipleListPlot`

MultipleListPlot[mt,  bt,  PlotJoined -> True]