?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Tracing an Insertion Sort

APCSA-4YHFM6

Given the following array, indicate what the array would look like after the third pass through the sort. Assume that you are sorting in ascending order and using an INSERTION SORT.

String[ ] letters = {"p", "b", "D", "E", "y", "S"};
A

["b", "p", "D", "E", "y", "S"]

B

["D", "E", "b", "p", "y", "S"]

C

["D", "b", "p", "E", "y", "S"]

D

["b", "p", "y", "E", "D", "S"]

E

["D", "E", "S", "b", "p", "y"]