Solved

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

Question 29

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents