// --- Directions // Implement bubbleSort, selectionSort, and mergeSort function bubbleSort(arr) { // Implement bubblesort for (let i = 0; i < arr.length; i++) { for (let j = 0; j < (arr.length - i - 1); j++) { if (arr[j] > arr[j+1]) { const lesser = arr[j+1]; arr[j+1] = arr[j]; arr[j] = lesser; } } } // return the sorted array return arr; } function insertionSort(arr){ for(let i = 1; i < arr.length; i++){ let currentNum = arr[i] let j = i - 1 while(currentNum < arr[j]){ const checkValue = arr[j]; arr[j] = currentNum; arr[j + 1] = checkValue; j--; } } return arr } function selectionSort(arr) { for (let i = 0; i < arr.length; i++) { let indexOfMin = i; for (let j = i+1; j