MCPcopy Create free account
hub / github.com/careercup/ctci / getMaxNaive

Method getMaxNaive

java/Chapter 17/Question17_4/Question.java:14–18  ·  view source on GitHub ↗
(int a, int b)

Source from the content-addressed store, hash-verified

12 }
13
14 public static int getMaxNaive(int a, int b) {
15 int k = sign(a - b);
16 int q = flip(k);
17 return a * k + b * q;
18 }
19
20 public static int getMax(int a, int b) {
21 int c = a - b;

Callers 1

mainMethod · 0.95

Calls 2

signMethod · 0.95
flipMethod · 0.95

Tested by

no test coverage detected