Package elki.utilities.datastructures
Interface QuickSelect.Adapter<T>
-
- Type Parameters:
T
- Data structure type
- All Known Implementing Classes:
PrecomputedDistanceMatrix.PrecomputedDistancePrioritySearcher
- Enclosing class:
- QuickSelect
public static interface QuickSelect.Adapter<T>
Adapter class to apply QuickSelect to arbitrary data structures.- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
compare(T data, int i, int j)
Compare two elements.default void
isSorted(T data, int begin, int end)
Notification callback that an array is completely sorted.void
swap(T data, int i, int j)
Swap the two elements at positions i and j.
-
-
-
Method Detail
-
swap
void swap(T data, int i, int j)
Swap the two elements at positions i and j.- Parameters:
data
- Data structurei
- Position ij
- Position j
-
compare
int compare(T data, int i, int j)
Compare two elements.- Parameters:
data
- Data structurei
- Position ij
- Position j- Returns:
-1,0,+1
when the element at position i is smaller, equal, or greater than that at position j.
-
isSorted
default void isSorted(T data, int begin, int end)
Notification callback that an array is completely sorted.- Parameters:
data
- Data structurebegin
- Begin of sorted intervalend
- End of sorted interval
-
-