Insertion Sort

Sorting Algorithms

Koowoy
1. Bubble Sort In each loop, place the largest number on the top, creating a “bubble” const bubbleSort = (arr) => { for (let i = arr.length - 1; i > 0; i--) { let swap = false; for (let j = 0; j < i; j++) { if(arr[j] > arr[j + 1]) { let temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; swap = true; } } if(!