collecting data of timing sorting algorithms and patterns using python
<p>I have 4 different sorting options(bubblesort, isort...) and 3 different patterns to it (random, reversed sorted, sorted). What I am trying to do now is to collect data which would show a table of specific increments of array, and corresponding time to it:</p>

<pre><code>Example: array of 500 with increments of 100
algorithm: bubblesort
data: sorted

array   time(sec)
100     0.0002
200     0.0003
300     0.0005
400     0.0009
500     0.001
</code></pre>

<p>what i have so far is:</p>

<pre><code>def sort_timehelp(x,f):
''' This times the quick sort algorithm as it must take 3 variables'''
high=len(x)
low=0
t0=clock()
f(x,low,high)
t1=clock()
dt=t1-t0
return dt

def main():
     sortfunction=input("Choose a sort function: ")
     s=input("Choose a pattern: ")
     n=input("Array Size: ")
     increment=input("Increment size: ")

     if s == 1:
        x=rand_array(n)
     elif s ==2:
        x= sorted_array(n)
     elif s==3:
        x=rev_array(n)
     if sortfunction==1:
        print sort_timehelp(x, quick_sort)
        print x[::increment]
</code></pre>

<p>whats the best and easiest way to accomplish that? Thanks for any feedback
my problem is of how can i make a table showed above.</p>
