From 0b6e562c61666a5e8f4bbb48dfe7b803039d739f Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Wed, 30 Jun 2021 12:24:25 +0300 Subject: [PATCH] Fix bubbleSort --- snippets/bubbleSort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/bubbleSort.md b/snippets/bubbleSort.md index 2e6931f3f..18557e451 100644 --- a/snippets/bubbleSort.md +++ b/snippets/bubbleSort.md @@ -17,7 +17,7 @@ Sorts an array of numbers, using the bubble sort algorithm. const bubbleSort = arr => { let swapped = false; const a = [...arr]; - for (let i = 1; i < a.length - 1; i++) { + for (let i = 1; i < a.length; i++) { swapped = false; for (let j = 0; j < a.length - i; j++) { if (a[j + 1] < a[j]) {