Solved

Consider the Following Code Snippet: Public Static Void Sort(int[]A) Insertion

Question 87

Multiple Choice

Consider the following code snippet: public static void sort(int[]A) insertion sort


A) {
For (int i = 1; i < a.length; i++)
{
Int next = a[i];
Int j = i;
While (j > 0 && a[j - 1] > next)
{
A[j] = a[j - 1];
J--;
}
A[j] = next;
}
}
What sort algorithm is used in this code?
B) selection sort
C) merge sort
D) quicksort

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions