1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
Files
go-mixed/sets/sorted_set.go
2022-05-06 17:29:35 +08:00

17 lines
247 B
Go

package sets
type sorted_set[T comparable] struct {
sorted []T
set Set[T]
}
func NewSortedSet[T comparable]() *sorted_set[T] {
return &sorted_set[T]{
set: NewHashSet[T](),
}
}
func (s *sorted_set[T]) ToSlice() []T {
return s.sorted
}