Esempio n. 1
0
import sorting

data = list(sorting.getData(100))

i = 0
while i < len(data):
    j=i
    while j > 0:
        sorting.compex(data, j-1, j)
        j-=1
    i+=1

print(data)
print("compex was called {0} times".format(sorting.counter))
    

   



Esempio n. 2
0
from sorting import compex

inputFile = open('data.txt', 'r', 1)
bytes = inputFile.read()
values = []
for w in bytes.split(','): 
    values.append(int(w))
print(values)
r = len(values)
print("r=" + str(r))

for i in range(0, r):
    print("i=" + str(i))
    for j in range(1, r-i):
        compex(values, j-1, j)
Esempio n. 3
0
import sorting

data = list(sorting.getData(100))

i = 0
while i < len(data):
    j = i
    while j > 0:
        sorting.compex(data, j - 1, j)
        j -= 1
    i += 1

print(data)
print("compex was called {0} times".format(sorting.counter))
Esempio n. 4
0
from sorting import compex

inputFile = open('data.txt', 'r', 1)
bytes = inputFile.read()
values = []
for w in bytes.split(','):
    values.append(int(w))
print(values)
r = len(values)
print("r=" + str(r))

for i in range(0, r):
    print("i=" + str(i))
    for j in range(1, r - i):
        compex(values, j - 1, j)