For unlimited access to Study Guides, a Grade+ subscription is required.
33. What is the second value printed by the program to the right? A.-1 B.O C.5 D.7 E.10 void setup() { int[] data = { 7, 10, 3, io, 6, 7, 15, 10, 10 System.out.println(func1(10, data)); System.out.println(func1(7, data)); 1/ look close - this is not quite the // same function as before int funci(int x, int[] data) { for(int i = data.length-1; i >= 0; i--) if (data[i] == x) return i; return -1;
Part (c) [1 MARK List [6, 5, 2, 3, 7, 1, 4] is being sorted using insertion sort. Fill in the blanks to show the list after the next two passes. After one pass: After two passes: [6, 5, 2, 3, 7, 1, 4] [5, 6, 2, 3, 7, 1, 4] After three passes: After four passes:
21. What prints in the following question. int[] [] x = { { 1, 2, 3} , {4, 5}, {6, 7}}; x[0] = new int [4]; System.out.println(x.length); (A) 3 (B) 8 (C) 7 (D) There is a compiler error. (E) 2