MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / getNextGap

Method getNextGap

src/main/java/com/thealgorithms/sorts/CombSort.java:27–30  ·  view source on GitHub ↗

Method to find the next gap @param gap the current gap @return the next gap value

(int gap)

Source from the content-addressed store, hash-verified

25 * @return the next gap value
26 */
27 private int getNextGap(int gap) {
28 gap = (int) (gap / SHRINK_FACTOR);
29 return Math.max(gap, 1);
30 }
31
32 /**
33 * Method to sort the array using CombSort

Callers 1

sortMethod · 0.95

Calls 1

maxMethod · 0.45

Tested by

no test coverage detected