class FastSortByte
extends java.lang.Object
It also uses a best-of-3 pivot selection for partitioning during quicksort, which is slower than DualPivotQuicksort but much simpler.
| Constructor and Description |
|---|
FastSortByte() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
quickSort(MutableByteIndexable elements,
ByteOrdering order) |
static void |
sort(byte[] bytes)
Sort the given byte array in natural order.
|
static void |
sort(byte[] bytes,
ByteOrdering order)
Sort the given byte array in user-defined order.
|
static void |
sort(byte[] bytes,
int startIndex,
int length)
Sort a part of the given byte array in natural order.
|
static void |
sort(byte[] bytes,
int startIndex,
int length,
ByteOrdering order)
Sort a part of the given byte array in user-defined order.
|
static void |
sort(MutableByteIndexable bytes)
Sort the given mutable byte indexable in natural order.
|
static void |
sort(MutableByteIndexable bytes,
ByteOrdering order)
Sort the given mutable byte indexable using the given ordering.
|
public static void sort(@NotNull byte[] bytes)
Arrays.sort(byte[]).bytes - byte arraypublic static void sort(@NotNull byte[] bytes, @NotNull ByteOrdering order)
Arrays.sort(byte[]).bytes - byte arrayorder - sort orderpublic static void sort(@NotNull byte[] bytes, int startIndex, int length)
Arrays.sort(byte[],int,int).bytes - byte arraystartIndex - start index into the byte array where the part to be sorted beginslength - length of the part to be sortedpublic static void sort(@NotNull byte[] bytes, int startIndex, int length, @NotNull ByteOrdering order)
Arrays.sort(byte[],int,int).bytes - byte arraystartIndex - start index into the byte array where the part to be sorted beginslength - length of the part to be sortedorder - sort orderpublic static void sort(@NotNull MutableByteIndexable bytes)
bytes - byte indexablepublic static void sort(@NotNull MutableByteIndexable bytes, @NotNull ByteOrdering order)
bytes - byte indexableorder - sort orderstatic void quickSort(@NotNull MutableByteIndexable elements, @NotNull ByteOrdering order)