diff --git a/CompileTimeTest.py b/CompileTimeTest.py index 0130211..5b01803 100755 --- a/CompileTimeTest.py +++ b/CompileTimeTest.py @@ -34,10 +34,17 @@ print "Fastest is %d" % (minIndex) -#rename fastest .py to *_optimized.py +#create *_optimized.py with SD set to False +file = open(testFileName + "_optimized.py", "w") fastestFileName = str(testFileName + "_T" + str(minIndex) + ".py") -os.rename(fastestFileName, testFileName + "_optimized.py") +for line in fileinput.input(fastestFileName): + line = line.replace("SD(TRUE", "SD(FALSE") + file.write(line) + +file.close() + +#remove temp testing files for filename in os.listdir("."): if filename.startswith(testFileName + "_T"): os.remove(filename) diff --git a/CompileTimeTest.py~ b/CompileTimeTest.py~ index 0130211..bdbc87a 100755 --- a/CompileTimeTest.py~ +++ b/CompileTimeTest.py~ @@ -34,10 +34,15 @@ minIndex, minValue = min(enumerate(dataStructureTimes), key=operator.itemgetter( print "Fastest is %d" % (minIndex) -#rename fastest .py to *_optimized.py +#create *_optimized.py with SD set to False +file = open(testFileName + "_optimized.py", "w") fastestFileName = str(testFileName + "_T" + str(minIndex) + ".py") -os.rename(fastestFileName, testFileName + "_optimized.py") +for line in fileinput.input(fastestFileName): + line = line.replace("SD(TRUE", "SD(FALSE") + file.write(line) + +#remove temp testing files for filename in os.listdir("."): if filename.startswith(testFileName + "_T"): os.remove(filename) diff --git a/DS.pyc b/DS.pyc index 2cd6322..23e9ed1 100644 Binary files a/DS.pyc and b/DS.pyc differ diff --git a/SmartDataStructure.pyc b/SmartDataStructure.pyc index f87776c..57e8c03 100644 Binary files a/SmartDataStructure.pyc and b/SmartDataStructure.pyc differ diff --git a/arr.pyc b/arr.pyc index f6067de..9c696a4 100644 Binary files a/arr.pyc and b/arr.pyc differ diff --git a/bst.pyc b/bst.pyc index 09f04b9..6444336 100644 Binary files a/bst.pyc and b/bst.pyc differ diff --git a/btree.pyc b/btree.pyc index d3d2a10..62a6ec2 100644 Binary files a/btree.pyc and b/btree.pyc differ diff --git a/graph_test.py b/graph_test.py index d4f176f..3671a01 100644 --- a/graph_test.py +++ b/graph_test.py @@ -4,8 +4,6 @@ import matplotlib.animation as animation from random import randint -value = "hi" - class LiveGraph(threading.Thread): def run(self): @@ -19,11 +17,14 @@ def data_gen(): data_gen.t = 0 fig = plt.figure() - ax = fig.add_subplot(111) - line, = ax.plot([], [], lw=2, color = "black") - ax.set_ylim(0, 100) - ax.set_xlim(0, window) - ax.grid() + ax1 = fig.add_subplot(2, 1, 1) + ax2 = fig.add_subplot(2, 1, 2) + + line, = ax1.plot([], [], lw=2, color = "black") + ax1.set_ylim(0, 100) + ax1.set_xlim(0, window) + ax1.grid() + xdata, ydata = [], [] def run(data): @@ -31,11 +32,11 @@ def run(data): t,y = data xdata.append(t) ydata.append(y) - xmin, xmax = ax.get_xlim() + xmin, xmax1 = ax1.get_xlim() - if t >= xmax: - ax.set_xlim(xmax, xmax + window) - ax.figure.canvas.draw() + if t >= xmax1: + ax1.set_xlim(xmax1, xmax1 + window) + ax1.figure.canvas.draw() line.set_data(xdata, ydata) return line, @@ -53,6 +54,10 @@ def run(data): while 1: ops = randint(0, 100) + get = randint(0, 100) + add = randint(0, 100) + remove = randint(0, 100) + contains = randint(0, 100) time.sleep(0.2) diff --git a/maxheap.pyc b/maxheap.pyc index 5fe8b3b..e373eb0 100644 Binary files a/maxheap.pyc and b/maxheap.pyc differ diff --git a/minheap.pyc b/minheap.pyc index 750e791..aa6185c 100644 Binary files a/minheap.pyc and b/minheap.pyc differ diff --git a/sarr.pyc b/sarr.pyc index f862a60..e9d3430 100644 Binary files a/sarr.pyc and b/sarr.pyc differ