merger

package
v0.0.0-...-add3f17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Btree

type Btree struct {
	// contains filtered or unexported fields
}

Btree attempts so sort and extend to reduce the memory consumption without requiring the full list to be in memory while processing. Processing is O(n*log(n)), Memory is O(n)

func NewBtree

func NewBtree() *Btree

func (*Btree) MergeInterval

func (m *Btree) MergeInterval(i *model.Interval)

func (*Btree) Result

func (m *Btree) Result() []*model.Interval

type Item

type Item struct {
	*model.Interval
}

func (Item) Less

func (i Item) Less(bi btree.Item) bool

type Noop

type Noop struct {
	// contains filtered or unexported fields
}

func (*Noop) MergeInterval

func (m *Noop) MergeInterval(i *model.Interval)

func (*Noop) Result

func (m *Noop) Result() []*model.Interval

type Simple

type Simple struct {
	// contains filtered or unexported fields
}

Simple ignores memory and cpu constraints. Alg should be O(n*log(n)) due the use of search search. Memory can be max O(2n) since the new list is created next to the existing list.

func NewSimple

func NewSimple() *Simple

func (*Simple) MergeInterval

func (m *Simple) MergeInterval(i *model.Interval)

func (*Simple) Result

func (m *Simple) Result() []*model.Interval

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址