diff --git a/app/src/main/java/de/uni_marburg/powersort/PowerSort.java b/app/src/main/java/de/uni_marburg/powersort/PowerSort.java new file mode 100644 index 0000000..7c7f5fc --- /dev/null +++ b/app/src/main/java/de/uni_marburg/powersort/PowerSort.java @@ -0,0 +1,26 @@ +package de.uni_marburg.powersort; + +import java.util.Comparator; + +class PowerSort { + /** + * Sorts the given range, using the given workspace array slice + * for temp storage when possible. This method is designed to be + * invoked from public methods (in class Arrays) after performing + * any necessary array bounds checks and expanding parameters into + * the required forms. + * + * @param a the array to be sorted + * @param lo the index of the first element, inclusive, to be sorted + * @param hi the index of the last element, exclusive, to be sorted + * @param c the comparator to use + * @param work a workspace array (slice) + * @param workBase origin of usable space in work array + * @param workLen usable size of work array + * @since 1.8 + */ + static void sort(T[] a, int lo, int hi, Comparator c, + T[] work, int workBase, int workLen) { + assert c != null && a != null && lo >= 0 && lo <= hi && hi <= a.length; + } +} \ No newline at end of file