bwtTernaryRadixSort

private fnvoid bwtTernaryRadixSort(uint[] indices, const(ubyte)[] block, uint lo, uint hi, int depth, uint[] temp) pure nothrow

Ternary radix quicksort for BWT indices.

This is a three-way partitioning radix sort that partitions elements into three groups based on a pivot byte: less than, equal to, and greater than. It's more efficient than counting sort for medium-sized arrays because it avoids the O(256) overhead of initializing count arrays.

The algorithm:

  1. Select pivot byte (median of three at current depth)
  2. Partition into <pivot, =pivot, >pivot regions
  3. Recursively sort < and > regions at same depth
  4. Recursively sort = region at depth+1

    Parameters

    indicesArray of indices to sort.
    blockThe data block.
    loStart of range (inclusive).
    hiEnd of range (exclusive).
    depthCurrent byte depth.
    tempTemporary buffer (unused here, for API compatibility).