Package com.complexible.common.base
Class Sorter<T>
- java.lang.Object
-
- com.complexible.common.base.Sorter<T>
-
- Direct Known Subclasses:
Sorter.QuickSorter
public abstract class Sorter<T> extends java.lang.Object
This class performs merge sort over an array but allocates the additional array used in merge sort upfront so if the arrays of same size will be sorted repeatedly this sorter can be reused to minimize garbage collection with the price of having memory for extra array always being used.- Author:
- Evren Sirin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sorter.QuickSorter<T>
Sorter implementation for QuickSort.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <T> Sorter<T>
create(int length, java.util.Comparator<? super T> comp)
abstract void
sort(T[] array, int start, int end)
-