Question #273644

Consider the following snippets of code. Then, identify and describe the sorting algorithm used. num scores[5] = 90,85,65,95,75 sort() x = 1 while x < SIZE temp = scores[x] y = x – 1 while y >= 0 AND scores[y]>temp scores[y+1] = scores[y] y = y – 1 endwhile scores[y+1] = temp


Expert's answer

The algorithm is bubble sort.

Bubble sort swaps the adjacent elements if the elements are in the wrong order. The swapping continues up to the last item.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS