









































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










































































LECTURE 05: SORTING ALGORITHMS
10 3 7 3 4 Unsorted list 3 3 4 7 10 Sorted list
Selection Sort Visualization Index Min
Selection Sort Visualization Index Min
Selection Sort Visualization Index Min
Selection Sort Visualization Index Min
Selection Sort Visualization Index Min
Selection Sort Visualization Index Min
Selection Sort Visualization
for (int index = 0; index < arr.length; index++) { int min = index; for (int curr = index + 1; curr < arr.length; curr++) { if (arr[curr] < arr[min]) { min = curr; } } swap(arr, index, min); }
Comparison of Sorting Algorithms Name Best Average Worst Memory Stable Method Selection n 2 n 2 n 2 1 No Selection