Skip to content

Instantly share code, notes, and snippets.

View jairhumberto's full-sized avatar
🫥
I may be slow to respond.

Humberto jairhumberto

🫥
I may be slow to respond.
View GitHub Profile
@jairhumberto
jairhumberto / bubbleSort.js
Created February 16, 2022 15:32
My implementation of Bubble sort
function bubbleSort(array) {
for (let i=1, sorted; !sorted; i++) {
sorted = 1;
for (let j=0; j < array.length - i; j++) {
if (array[j] > array[j+1]) {
[array[j+1], array[j], sorted] = [array[j], array[j+1], 0];
}
}
}