Documentation
¶
Index ¶
Constants ¶
View Source
const Threshold = 200
Threshold defines the threshold at which the algorithm switches to partition in parallel/concurrent mode
Variables ¶
This section is empty.
Functions ¶
func Quicksort ¶
func Quicksort[T comparable](arr []T, cmp func(v, pivot T) bool)
Quicksort sorts the given array using the quicksort algorithm in concurrent/parallel mode, in-place.
best | worst | avg | effective time 0(nlog(n)) | 0(n^2) | 0(nlog(n)) space 0(log(n)) | 0(1) | 0(log(n)) effective space 0(nlog(n)) avg | 0(log(n) + sqrt(n)) - due to concurrency overhead
func QuicksortASC ¶
QuicksortASC invokes Quicksort in ascending order
func QuicksortDESC ¶
QuicksortDESC invokes Quicksort in descending order
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.