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

Method swap

java/Introduction/SwapMinMax/SwapMinMax.java:27–31  ·  view source on GitHub ↗
(int[] array, int m, int n)

Source from the content-addressed store, hash-verified

25 }
26
27 public static void swap(int[] array, int m, int n) {
28 int temp = array[m];
29 array[m] = array[n];
30 array[n] = temp;
31 }
32
33 public static void swapMinMaxBetter(int[] array) {
34 int minIndex = getMinIndex(array);

Callers 1

swapMinMaxBetterMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected