Solved

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

Question 30

Multiple Choice

The following algorithm represents the logic of a(n) ____.
// Loop pulls each element from 1 to the end of the array
For pulledIndex = 1 to ARRAYSIZE - 1
PulledValue = someNums[pulledIndex]
InsertIndex = pulledIndex

// If element to the left is greater,
// shift it to the right
// and look at the next element to the left
While insertIndex > 0
And someNums[insertIndex - 1] > pulledValue
SomeNums[insertIndex] = someNums[insertIndex - 1]
InsertIndex = insertIndex - 1
End While

// Insert the pulled value when the shifting ends
SomeNums[insertIndex] = pulledValue
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