|
@@ -52,28 +52,28 @@ acumulaShell=0 #variable para acumular el tiempo de ejecucion del shellsort
|
52
|
52
|
for i in range(veces):
|
53
|
53
|
lista = [randint(0,maxValor) for r in range(largoLista)]
|
54
|
54
|
|
55
|
|
- t1 = time.process_time()
|
|
55
|
+ t1 = time.clock()
|
56
|
56
|
mergeSort(lista)
|
57
|
|
- acumulaMerge+=time.process_time()-t1
|
|
57
|
+ acumulaMerge+=time.clock()-t1
|
58
|
58
|
|
59
|
|
- t1 = time.process_time()
|
|
59
|
+ t1 = time.clock()
|
60
|
60
|
heapSort(lista)
|
61
|
|
- acumulaHeap+=time.process_time()-t1
|
|
61
|
+ acumulaHeap+=time.clock()-t1
|
62
|
62
|
|
63
|
|
- t1 = time.process_time()
|
64
|
|
- quickSort(lista)
|
65
|
|
- acumulaQuick+=time.process_time()-t1
|
|
63
|
+ t1 = time.clock()
|
|
64
|
+ quickSort(lista)
|
|
65
|
+ acumulaQuick+=time.clock()-t1
|
66
|
66
|
|
67
|
|
- t1 = time.process_time()
|
|
67
|
+ t1 = time.clock()
|
68
|
68
|
shellSort(lista)
|
69
|
|
- acumulaShell+=time.process_time()-t1
|
|
69
|
+ acumulaShell+=time.clock()-t1
|
70
|
70
|
|
71
|
71
|
|
72
|
|
-print ("Promedio de tiempo de ejecucion de "+ str(veces) +" listas de largo " + str(largoLista))
|
73
|
|
-print ("MergeSort " + str(acumulaMerge/veces) + " segundos")
|
74
|
|
-print ("HeapSort " + str(acumulaHeap/veces) + " segundos")
|
75
|
|
-print ("QuickSort " + str(acumulaQuick/veces) + " segundos")
|
76
|
|
-print ("ShellSort " + str(acumulaShell/veces) + " segundos")
|
|
72
|
+print "Promedio de tiempo de ejecucion de "+ str(veces) +" listas de largo " + str(largoLista)
|
|
73
|
+print "MergeSort " + str(acumulaMerge/veces) + " segundos"
|
|
74
|
+print "HeapSort " + str(acumulaHeap/veces) + " segundos"
|
|
75
|
+print "QuickSort " + str(acumulaQuick/veces) + " segundos"
|
|
76
|
+print "ShellSort " + str(acumulaShell/veces) + " segundos"
|
77
|
77
|
|
78
|
78
|
|
79
|
79
|
|