瀏覽代碼

Add new comments

Carla Ramos 1 年之前
父節點
當前提交
60c0cfb1a0
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. 5
    0
      sorting.py

+ 5
- 0
sorting.py 查看文件

@@ -13,6 +13,9 @@ import time
13 13
 
14 14
 def mergeSort(lista):
15 15
 	#definan el algoritmo de ordenamiento mergesort
16
+	# Carla Ramos Bezares
17
+	# Para realizar este código leí las explicaciones e implementaciones que ofrecen
18
+	# GeeksforGeeks y Progamiz
16 19
 
17 20
 	# check if the array has more than one element
18 21
     if len(lista) > 1:
@@ -27,6 +30,8 @@ def mergeSort(lista):
27 30
 
28 31
         i = j = k = 0
29 32
 
33
+		# using our "smaller" arrays, place elements in the correct position of our array
34
+
30 35
         while i < len(leftHalf) and j < len(rightHalf):
31 36
             if leftHalf[i] < rightHalf[j]:
32 37
                 lista[k] = leftHalf[i]