mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
add PowerSort interface
This commit is contained in:
parent
01db748f3e
commit
c11238ea8b
26
app/src/main/java/de/uni_marburg/powersort/PowerSort.java
Normal file
26
app/src/main/java/de/uni_marburg/powersort/PowerSort.java
Normal file
@ -0,0 +1,26 @@
|
||||
package de.uni_marburg.powersort;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
class PowerSort<T> {
|
||||
/**
|
||||
* 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 <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c,
|
||||
T[] work, int workBase, int workLen) {
|
||||
assert c != null && a != null && lo >= 0 && lo <= hi && hi <= a.length;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user