forked from hofmannol/AlgoDatSoSe25
Made pr03 ready for handing it in
This commit is contained in:
parent
f033738d31
commit
fe314b7c6c
@ -179,14 +179,12 @@ if __name__ == '__main__':
|
||||
quickSortIterative(toSort, Literal(0), toSort.length().pred())
|
||||
print(toSort)
|
||||
|
||||
analyze_complexity(quickSortIterative, [10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
|
||||
'''
|
||||
# analyze_complexity(quickSortIterative, [10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
|
||||
for filename in ["data/seq0.txt", "data/seq1.txt", "data/seq2.txt" ,"data/seq3.txt"]:
|
||||
# for filename in [ "data/seq1.txt"]:
|
||||
print(filename)
|
||||
toSort = MemoryArray.create_array_from_file(filename)
|
||||
timeMS(quickSortIterative, toSort, Literal(0), toSort.length().pred(), mode=0)
|
||||
timeMS(quickSortIterative, toSort, Literal(0), toSort.length().pred(), mode=1)
|
||||
# print(toSort)
|
||||
'''
|
||||
|
||||
print("Kann durch die Modifikation eine besser Laufzeit als nlog(n) erreicht werden? Nein! nlog(n) ist das Minimum. Durch die Änderung kann aber der Worst-Case fall von n^2 für z.B. bereits vorsortierte Arrays oder Arrays mit vielen Duplikaten vermieden werden.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user