Documentation ¶
Index ¶
- Variables
- func BuiltInSort[T cmp.Ordered](slice []T) []T
- func GenerateSlice[T cmp.Ordered](size int, generator func(int) T) []T
- func HeapSort[T cmp.Ordered](slice []T) []T
- func MaxHeapPop[T cmp.Ordered](slice []T)
- func MaxHeapShiftDown[T cmp.Ordered](slice []T, i, size int)
- func MaxHeapify[T cmp.Ordered](slice []T)
- func MergeSlices[T cmp.Ordered](left, right []T) []T
- func MergeSort[T cmp.Ordered](slice []T) []T
- func ParallelMergeSort[T cmp.Ordered](slice []T) []T
- func ParallelQuickSort[T cmp.Ordered](slice []T) []T
- func ParseBenchmark(name, rawBenchmark string) benchmark.Benchmark
- func QuickSort[T cmp.Ordered](slice []T) []T
- func RandomIntGenerator(max int) func(int) int
Constants ¶
This section is empty.
Variables ¶
View Source
var TestCases = []struct { Size int }{ {Size: 50000}, {Size: 100000}, {Size: 500000}, {Size: 1000000}, }
Defines the test cases for sorting algorithms, i.e. the input sizes to test
Functions ¶
func BuiltInSort ¶
func GenerateSlice ¶
Generates a slice of length size with elements generated by generator
func MaxHeapPop ¶
Usage: HeapSort Moves the largest element to the end of the slice and shifts the heap down
func MaxHeapShiftDown ¶
Usage: HeapSort Shifts the element at index i down the heap until it is in the correct position
func MaxHeapify ¶
Usage: HeapSort Builds a max heap from the slice
func MergeSlices ¶
Usage: MergeSort, MergeSortParallel Merges two sorted slices into a single sorted slice
func ParallelMergeSort ¶
func ParallelQuickSort ¶
func ParseBenchmark ¶
Wrapper around base parsing, adding input size to each test case
func RandomIntGenerator ¶
Generates a random integer generator that generates integers in the range [0, max)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.