MCPcopy Create free account
hub / github.com/SAKET-SK/Programming-Aptitude-Interview-Prep / func

Method func

Cognizant/Que 21/Solution.java:9–21  ·  view source on GitHub ↗
(int i, int cb, int t, int ww)

Source from the content-addressed store, hash-verified

7 static int c[];
8
9 public static int func (int i, int cb, int t, int ww)
10 {
11 if (i == n)
12 {
13 if ((cb & 1) != 0)
14 return 0;
15 else
16 return t;
17 }
18 if (ww + b[i] <= w)
19 return Math.max (func (i + 1, cb + c[i], t + a[i], ww + b[i]),func (i + 1, cb, t, ww));
20 return func (i + 1, cb, t, ww);
21 }
22
23 public static void main (String[]args)
24 {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected