Oracle
1Z0-819 · Question #85
1Z0-819 Question #85: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-819 to reveal the answer and full explanation for question #85. The question stem and answer options stay visible for context.
Question
Given:
- void insertionSort (int values[]) {
- int n = values.length;
- for (int i = 1; i < n; i++) {
- int tmp = values[i];
- int j = i - 1;
- while (j >= 0 && (values[j] > tmp)) {
- values[j + 1] = values[j];
- j--;
- }
- values[j + 1] = tmp;
- }
- } After which line can we insert insert i < 0 || values[i] <= values[i + 1]; to verify that the values array is partially sorted?
Options
- AAfter line 8
- BAfter line 6
- CAfter line 5
- DAfter line 10
Unlock 1Z0-819 to see the answer
You've previewed enough free 1Z0-819 questions. Unlock 1Z0-819 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.