Timsort is a simple generic implementation of Timsort algorithm.
(data []T)
| 11 | |
| 12 | // Timsort is a simple generic implementation of Timsort algorithm. |
| 13 | func Timsort[T constraints.Ordered](data []T) []T { |
| 14 | runSize := calculateRunSize(len(data)) |
| 15 | insertionSortRuns(data, runSize) |
| 16 | mergeRuns(data, runSize) |
| 17 | return data |
| 18 | } |
| 19 | |
| 20 | // calculateRunSize returns a run size parameter that is further used |
| 21 | // to slice the data slice. |
nothing calls this directly
no test coverage detected