Class TimSorter
Sorter implementation based on the TimSort algorithm.
This implementation is especially good at sorting partially-sorted arrays and sorts small arrays with binary sort.
NOTE:There are a few differences with the original implementation:
- The extra amount of memory to perform merges is
configurable. This allows small merges to be very fast while large merges
will be performed in-place (slightly slower). You can make sure that the
fast merge routine will always be used by having
maxTempSlots
equal to half of the length of the slice of data to sort. - Only the fast merge routine can gallop (the one that doesn't run in-place) and it only gallops on the longest slice.
@lucene.internal
Assembly: DistributedLucene.Net.dll
Syntax
public abstract class TimSorter : Sorter
Constructors
Name | Description |
---|---|
TimSorter(Int32) | Create a new TimSorter. |
Methods
Name | Description |
---|---|
CompareSaved(Int32, Int32) | Compare element |
Copy(Int32, Int32) | Copy data from slot |
Restore(Int32, Int32) | Restore element |
Save(Int32, Int32) | Save all elements between slots |
Sort(Int32, Int32) | Sort the slice which starts at |