Documentation ¶
Overview ¶
Package sortlist implements a sorted list that is built incrementally. The list is in blocks of blockSize. Blocks are individually sorted once they are full. Blocks are two-way merged. A background goroutine is used to do the sorting and merging concurrently.
Blocks are recycled by merges so we use at most two extra blocks.
Note: Zero is used as a terminator, it must not be added as a value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder[T any] struct { // contains filtered or unexported fields }
func NewSorting ¶
NewSorting returns a new list Builder with incremental sorting. WARNING: this creates a goroutine which must be ended by Finish.
func NewUnsorted ¶
NewUnsorted returns a new list Builder without sorting.
func (*Builder[T]) Finish ¶
Finish completes sorting and merging and returns the ordered List. No more values should be added after this.