Question: For selection sort, what is the correct statement for the inner loop? / / Find index of smallest remaining element indexSmallest = i for (

For selection sort, what is the correct statement for the inner loop?
// Find index of smallest remaining element
indexSmallest = i
for (j = i +1; j < numbersSize; ++j){
if (/* WHAT CODE GOES HERE? */){
indexSmallest = j
}
}
// Swap numbers[i] and numbers[indexSmallest]
temp = numbers[i]
numbers[i]= numbers[indexSmallest]
numbers[indexSmallest]= temp
}
Group of answer choices
numbers[j]== numbers[indexSmallest]
numbers[j]< numbers[indexSmallest]
numbers[j]> numbers[indexSmallest]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!