From a6d33e15ca56ee2eac36f1dd460af5a2ebf54e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Guzm=C3=A1n?= <151692482+nguzm4n@users.noreply.github.com> Date: Fri, 22 Mar 2024 09:44:56 -0300 Subject: [PATCH] Update sorting-algorithms-explanied-in-javascript.es.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrección del algoritmo de select, ya que tenia un -1 de más dentro del bucle for, que impedía iterar sobre todos los elementos del array. --- .../lesson/sorting-algorithms-explanied-in-javascript.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/lesson/sorting-algorithms-explanied-in-javascript.es.md b/src/content/lesson/sorting-algorithms-explanied-in-javascript.es.md index c4aa03ae9..7adbb2256 100644 --- a/src/content/lesson/sorting-algorithms-explanied-in-javascript.es.md +++ b/src/content/lesson/sorting-algorithms-explanied-in-javascript.es.md @@ -59,7 +59,7 @@ En javascript const selectSort = (arr) => { let min = 0; while (min < arr.length-1){ - for(let i = min+1; i < arr.length-1; i++) { + for(let i = min+1; i < arr.length; i++) { if (arr[min] > arr[i]) { let aux = arr[min]; arr[min] = arr[i];