itermerge

package module
v0.0.0-...-a892684 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: MIT Imports: 1 Imported by: 0

README

itermerge

GoDoc Reference Build Status Coverage Status Go Report Card

Description

Package itermerge is a package that provides primitives for an heap of iterators. It's a generic package when used in conjunction with github.com/taylorchu/generic.

Installation

This package can be installed with the go get command:

go get github.com/ebonetti/itermerge

Documentation

API documentation can be found in the associated godoc reference

Documentation

Overview

Package itermerge is a package that provides primitives for an heap of iterators. It's a generic package when used in conjunction with github.com/taylorchu/generic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IterMerge

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

IterMerge is a min-heap of heap elements provided by user-defined iterator of sorted elements.

func IterMergeFrom

func IterMergeFrom(nexts ...func() (info Type, ok bool)) *IterMerge

IterMergeFrom creates a new heap of iterators from user-defined iterator of sorted elements.

func (*IterMerge) Next

func (m *IterMerge) Next() (info Type, ok bool)

Next returns the next element in the heap, if none ok is false; this method use the same logic as the iterators.

func (IterMerge) Peek

func (m IterMerge) Peek() (info Type, ok bool)

Peek peeks the next element in the heap.

func (*IterMerge) Push

func (m *IterMerge) Push(next func() (Type, bool))

Push adds an iterator to an existing IterMerge.

type Type

type Type looseLesser

Type is the generic placeholder.

Jump to

Keyboard shortcuts

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