Documentation ¶
Overview ¶
Package sortutil implements utilities for sorting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ByLesser ¶
type ByLesser struct { Lesser Lesser Slice []interface{} }
ByLesser implements the heap.Interface using a Lesser over a slice.
func (*ByLesser) Clear ¶
func (s *ByLesser) Clear()
Clear removes all elements from the underlying slice.
func (ByLesser) Peek ¶
func (s ByLesser) Peek() interface{}
Peek returns the least element in the heap. nil is returned if the heap is empty.
func (*ByLesser) Pop ¶
func (s *ByLesser) Pop() interface{}
Pop implements part of the heap.Interface
type Lesser ¶
type Lesser interface { // Less returns true if a < b. Less(a, b interface{}) bool }
Lesser is an interface to a comparison function.
type LesserFunc ¶
type LesserFunc func(a, b interface{}) bool
LesserFunc implements the Lesser interface using a function.
func (LesserFunc) Less ¶
func (f LesserFunc) Less(a, b interface{}) bool
Less implements the Lesser interface.
Click to show internal directories.
Click to hide internal directories.