4 ms·
It's guaranteed to run in O(n log n) time. Currently it uses quicksort with heapsort as a fallback to prevent quicksort's quadratic worst-case time. https://go
by pjscott 8y ago
It's guaranteed to run in O(n log n) time. Currently it uses quicksort with heapsort as a fallback to prevent quicksort's quadratic worst-case time.
https://golang.org/src/sort/sort.go?s=5414:5439#L206 https://golang.org/src/sort/sort.go?s=5414:5439#L206