sorter

package
v0.0.0-...-53ff736 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LEVEL_THRESHOLD
	// after that many levels of recursion we fall back to introsort anyway
	// this is used as a protection against the fact that radix sort performs
	// worse when there are long common prefixes (probably because of cache
	// locality)
	LEVEL_THRESHOLD = 8

	// HISTOGRAM_SIZE
	// size of histograms: 256 + 1 to indicate that the string is finished
	HISTOGRAM_SIZE = 257

	// LENGTH_THRESHOLD
	// buckets below this size will be sorted with introsort
	LENGTH_THRESHOLD = 100
)
View Source
const (
	// INSERTION_SORT_THRESHOLD
	// Below this size threshold, the sub-range is sorted using Insertion sort.
	INSERTION_SORT_THRESHOLD = 16
)
View Source
const (
	// SINGLE_MEDIAN_THRESHOLD
	// Below this size threshold, the partition selection is simplified to a single median.
	SINGLE_MEDIAN_THRESHOLD = 40
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MSBRadixInterface

type MSBRadixInterface interface {
	Compare(i, j, skipBytes int) int
	Swap(i, j int)
	ByteAt(i int, k int) int
}

type Sorter

type Sorter interface {
	Sort(from, to int)
}

func NewMsbRadixSorter

func NewMsbRadixSorter(maxLength int, sorter MSBRadixInterface) Sorter

func NewPdqSorter

func NewPdqSorter(data sort.Interface) Sorter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL