import { generateRandomArray, isSort } from "../util/index.mjs"; export function insertionSort(arr){ let n = arr.length; for (let i = 1; i=0 && arr[j] > currentElement) { arr[j+1] = arr[j] j-- } arr[j+1] = currentElement } } let arr = generateRandomArray(1000) insertionSort(arr) console.log(isSort(arr));