Ask Question
24 July, 04:25

Consider the following list. list = {24, 20, 10, 75, 70, 18, 60, 35} Suppose that list is sorted using the selection sort algorithm as discussed in the book. What is the resulting list after two passes of the sorting phase; that is, after two iterations of the outer for loop? list = {10, 18, 24, 20, 75, 70, 60, 35} list = {10, 18, 20, 24, 75, 70, 60, 35} list = {10, 18, 24, 75, 70, 20, 60, 35} list = {10, 20, 24, 75, 70, 20, 60, 35}

+3
Answers (1)
  1. 24 July, 07:26
    0
    list = {10, 18, 24, 75, 70, 20, 60, 35}

    Explanation:

    Selection is a sorting algorithm that will set a cursor position and search for a minimum number from the list. When the minimum number is found, that minimum number will be swapped with the number in the cursor position. Only one number will be swapped and sorted in one iteration of outer loop. To sort the next number in the following outer loop iteration, the cursor will be moved to the next position and repeat the same search and swapping process as in the first iteration. When finishing all the iterations of outer loop, all numbers shall be sorted in ascending order.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Consider the following list. list = {24, 20, 10, 75, 70, 18, 60, 35} Suppose that list is sorted using the selection sort algorithm as ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers