Browse Source

update from python2 to python3

José C.S. Curet 1 year ago
parent
commit
e08cae0dd7
1 changed files with 17 additions and 17 deletions
  1. 17
    17
      sorting.py

+ 17
- 17
sorting.py View File

@@ -63,27 +63,27 @@ for i in range(veces):
63 63
 	quicklista=list(mergelista)
64 64
 	searchlista=list(mergelista)
65 65
 
66
-	t1 = time.clock() 				#seteamos el tiempo al empezar
67
-	mergeSort(mergelista) 				#ejecutamos el algoritmo mergeSort
68
-	acumulaMerge+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
66
+	# t1 = time.time() 				#seteamos el tiempo al empezar
67
+	# mergeSort(mergelista) 				#ejecutamos el algoritmo mergeSort
68
+	# acumulaMerge+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
69 69
 	
70
-	t1 = time.clock()				#seteamos el tiempo al empezar
71
-	heapSort(heaplista)					#ejecutamos el algoritmo heapSort
72
-	acumulaHeap+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
70
+	# t1 = time.time()				#seteamos el tiempo al empezar
71
+	# heapSort(heaplista)					#ejecutamos el algoritmo heapSort
72
+	# acumulaHeap+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
73 73
 	
74
-	t1 = time.clock()				#seteamos el tiempo al empezar
75
-	quickSort(quicklista)				#ejecutamos el algoritmo quickSort
76
-	acumulaQuick+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
74
+	t1 = time.time()				#seteamos el tiempo al empezar
75
+	quickSort(quicklista, 0, len(quicklista) - 1)				#ejecutamos el algoritmo quickSort
76
+	acumulaQuick+=time.time()-t1 	#acumulamos el tiempo de ejecucion
77 77
 	
78
-	t1 = time.clock()				#seteamos el tiempo al empezar
79
-	shellSort(searchlista)				#ejecutamos el algoritmo shellSort
80
-	acumulaShell+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
78
+	# t1 = time.time()				#seteamos el tiempo al empezar
79
+	# shellSort(searchlista)				#ejecutamos el algoritmo shellSort
80
+	# acumulaShell+=time.clock()-t1 	#acumulamos el tiempo de ejecucion
81 81
 
82 82
 #imprimos los resultados
83
-print "Promedio de tiempo de ejecucion de "+ str(veces) +" listas de largo " + str(largoLista)
84
-print "MergeSort " + str(acumulaMerge/veces) + " segundos"
85
-print "HeapSort " + str(acumulaHeap/veces) + " segundos"
86
-print "QuickSort " + str(acumulaQuick/veces) + " segundos"
87
-print "ShellSort " + str(acumulaShell/veces) + " segundos"
83
+print("Promedio de tiempo de ejecucion de "+ str(veces) +" listas de largo " + str(largoLista))
84
+# print("MergeSort " + str(acumulaMerge/veces) + " segundos")
85
+# print("HeapSort " + str(acumulaHeap/veces) + " segundos")
86
+print("QuickSort " + str(acumulaQuick/veces) + " segundos")
87
+# print("ShellSort " + str(acumulaShell/veces) + " segundos")
88 88
 
89 89