Data Structures and Algorithms20785 marksNumerical: selection sort hand testComparison Sorting Algorithms
Hand test selection sort with array of numbers 4, 71, 32, 19, 61, 2, -5 in descending order.
Hand test selection sort with array of numbers 4, 71, 32, 19, 61, 2, -5 in descending order. [5]
Given data: - Array: $[4, 71, 32, 19, 61, 2, -5]$ - Number of elements: $n = 7$ - Sort order: Descending - Algorithm: Selection Sort --- Selection sort (descending): In each pass, find the largest element in the unsorted portion and swap it to the front of that portion. Index 0 1 2 3 4 5 6 ------...