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

Method swapMinMaxBetter

java/Introduction/SwapMinMax/SwapMinMax.java:33–37  ·  view source on GitHub ↗
(int[] array)

Source from the content-addressed store, hash-verified

31 }
32
33 public static void swapMinMaxBetter(int[] array) {
34 int minIndex = getMinIndex(array);
35 int maxIndex = getMaxIndex(array);
36 swap(array, minIndex, maxIndex);
37 }
38
39 public static void swapMinMax(int[] array) {
40 int minIndex = 0;

Callers 1

mainMethod · 0.95

Calls 3

getMinIndexMethod · 0.95
getMaxIndexMethod · 0.95
swapMethod · 0.95

Tested by

no test coverage detected