Browse Source

Add new comments

Carla Ramos 2 years ago
parent
commit
60c0cfb1a0
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      sorting.py

+ 5
- 0
sorting.py View File

@@ -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]