In [1]:
from quicksort import *
import numpy as np
from numpy import *
import matplotlib.pyplot as pyplot

In [35]:
## to visually check my quicksort works:

for j in range(10):
    data = np.random.randint(50,size=50)
    pyplot.bar(range(len(data)),quicksort(data),width=1);pyplot.show()



In [36]:
## testing my quicksort against numpy sorting:

results = []
for j in range(1000):
    data = np.random.randint(50,size=50)
    results.append(all(quicksort(data) == np.sort(data)))
all(results)


Out[36]:
True

In [ ]: