Solved

The Following Algorithm Represents the Logic of A(n) ____

Question 26

Multiple Choice

The following algorithm represents the logic of a(n) ____.
// Outer loop designates a position
// from first to last element
For currEl = 0 To ARRAYSIZE - 1
MinValue = someNums[currEl]
MinPosition = currEl
// Inner loop steps through array,
// finding smallest value
For index = currEl + 1 To ARRAYSIZE - 1
If someNums[index] < minValue Then
MinValue = someNums[index]
MinPosition = index
End If
End For

// Swap minimum value with element at
// designated position if different
If minPosition != currEl Then
Temp = someNums[currEl]
SomeNums[currEl] = someNums[minPosition]
SomeNums[minPosition] = temp
End If
End For


A) selection sort
B) insertion sort
C) bubble sort
D) merge sort

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions