Limited access

Upgrade to access all content for this subject

Which of the following BEST describes an Insertion Sort?

A

This sort algorithm searches the remaining higher-indexed elements in the list for the proper spot to insert the current element. Once the pass is completed, if an element is found that is less than the current element, then the current element will be inserted after it.

B

When using this sort algorithm and sorting array [6, 2, 30, 10, 1], the first pass results in [1, 2, 30, 10, 6].

C

This sort algorithm will split the list into two halves if necessary.

D

This sort algorithm examines the current element and puts it in the proper position relative to the previous lower-indexed elements, as it makes its way through the list.

E

Insertion sort is considered a “Swap-Hop” algorithm. Each pass through the loop, the current element will either swap with another element or “hop” to the proper position, depending on the situation.

Select an assignment template