public interface ISortableData
SortableDataUtils
to supports basic algorithms, such
as sorting and binary search on any data which can be mapped to a random
access list. The main benefit of this interface is that the type of data is
operated on must not be known (or be a concrete type), thus it can also be
used to sort data spread over multiple lists or arrays.Modifier and Type | Method and Description |
---|---|
boolean |
isLess(int i,
int j)
Returns whether the element stored at index
i is smaller
than the one stored at j . |
int |
size()
Returns the number of elements.
|
void |
swap(int i,
int j)
Swaps the elements at the given indices.
|