You are viewing a single comment's thread. Return to all comments →
for (let i =0; i<n; i++){ let j =0 if(arr[i] == arr[j]) continue for(j; j<=i; j++){ if(arr[i] < arr[j]){ let temp = arr[i] arr[i] = arr[j] arr[j] = temp } } console.log(arr.join(" ")) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 2
You are viewing a single comment's thread. Return to all comments →
JS