MCPcopy Create free account
hub / github.com/ReadyTalk/avian / insertionSort

Method insertionSort

classpath/java/util/Arrays.java:245–257  ·  view source on GitHub ↗
(T[] array,
    Comparator<? super T> comparator)

Source from the content-addressed store, hash-verified

243 }
244
245 private static <T> void insertionSort(T[] array,
246 Comparator<? super T> comparator)
247 {
248 for (int j = 1; j < array.length; ++j) {
249 T t = array[j];
250 int i = j - 1;
251 while (i >= 0 && comparator.compare(array[i], t) > 0) {
252 array[i + 1] = array[i];
253 i = i - 1;
254 }
255 array[i + 1] = t;
256 }
257 }
258
259 public static int hashCode(Object[] array) {
260 if(array == null) {

Callers 1

sortMethod · 0.95

Calls 1

compareMethod · 0.65

Tested by

no test coverage detected