For unlimited access to Study Guides, a Grade+ subscription is required.
57. Line 5 (A) for (int j = -i*2; j<= i*2; j++){ (B) for (int j = 0; j< i+2+1; j++){ (C) for (int j = -i; j> i; j++) { (D) for (int j = 0; j<= i*2; j++){ (E) for (int j = i; j<= i+2; j+i) {
24. Consider the Insertion Sort (code 3) algorithm described in the appendix. How can we change this code to have the algorithm sort from largest to smallest instead? (A) Change line 9 to: a[j-1] = a[j]; (B) Change line 7 to: while(j >0 && a[j - 1] 0; i--) (E) Change line 12 to: a[i] = x;
55. Line 3 (A) for (int j = height; j< height - i; j+-height) { (B) for (int j = 0; j< 2 + height; j+=height) { (C) for (int j = 0; j< height - i * 2; j++) { (D) for (int j = 0; j< height - i-1; j++) { (E) for (int j = 0; j< height ; j++) {