Lines Matching refs:b
43 static int oneArrayAbs(int[] a, int[] b) { in oneArrayAbs() argument
45 for (int i = Math.abs(b.length); i < a.length; i++) { in oneArrayAbs()
59 static int twoArrays(int[] a, int[] b) { in twoArrays() argument
61 for (int i = 0; i < Math.min(a.length, b.length); i++) { in twoArrays()
62 x += a[i] + b[i]; in twoArrays()
75 static int threeArrays(int[] a, int[] b, int[] c) { in threeArrays() argument
77 for (int i = 0; i < Math.min(Math.min(a.length, b.length), c.length); i++) { in threeArrays()
78 x += a[i] + b[i] + c[i]; in threeArrays()
92 static int fourArrays(int[] a, int[] b, int[] c, int[] d) { in fourArrays() argument
94 for (int i = 0; i < Math.min(Math.min(a.length, b.length), Math.min(c.length, d.length)); i++) { in fourArrays()
95 x += a[i] + b[i] + c[i] + d[i]; in fourArrays()
131 static int twoArraysWithCleanup(int[] a, int[] b) { in twoArraysWithCleanup() argument
133 int n = Math.min(a.length, b.length); in twoArraysWithCleanup()
135 x += a[i] + b[i]; in twoArraysWithCleanup()
154 static int threeArraysWithCleanup(int[] a, int[] b, int[] c) { in threeArraysWithCleanup() argument
156 int n = Math.min(a.length, Math.min(b.length, c.length)); in threeArraysWithCleanup()
158 x += a[i] + b[i] + c[i]; in threeArraysWithCleanup()
173 static int altLoopLogic(int[] a, int[] b) { in altLoopLogic() argument
175 int n = Math.min(a.length, b.length); in altLoopLogic()
177 x += a[i] + b[i]; in altLoopLogic()
189 static int hiddenMin(int[] a, int[] b) { in hiddenMin() argument
191 for (int i = 0; i < a.length && i < b.length; i++) { in hiddenMin()
192 x += a[i] + b[i]; in hiddenMin()
207 static int hiddenMinWithCleanup(int[] a, int[] b) { in hiddenMinWithCleanup() argument
210 for (; i < a.length && i < b.length; i++) { in hiddenMinWithCleanup()
211 x += a[i] + b[i]; in hiddenMinWithCleanup()
221 int[] b = { 6, 7, 8, 9, 4, 2 }; in main() local
227 expectEquals(36, oneArray(b)); in main()
235 expectEquals(49, twoArrays(a, b)); in main()
240 expectEquals(33, threeArrays(a, b, c)); in main()
241 expectEquals(58, threeArrays(a, b, d)); in main()
245 expectEquals(49, fourArrays(a, b, c, d)); in main()
248 expectEquals(90, oneArrayWithCleanup(b)); in main()
253 expectEquals(49, twoArraysWithCleanup(a, b)); in main()
258 expectEquals(42, threeArraysWithCleanup(a, b, c)); in main()
259 expectEquals(63, threeArraysWithCleanup(a, b, d)); in main()
263 expectEquals(49, altLoopLogic(a, b)); in main()
268 expectEquals(49, hiddenMin(a, b)); in main()
273 expectEquals(49, hiddenMinWithCleanup(a, b)); in main()