algorithms/sorting/sort.go

14 lines
245 B
Go
Raw Normal View History

2021-12-06 08:01:25 +02:00
package sorting
type Sortable interface {
Len() int
Swap(i, j int)
Less(i, j int) bool
}
type Sorter interface {
Sort(Sortable)
// TODO: add generic slice sort when type variables are landed
// SortSlice[T any](T, func(i, j int) bool)
}