loser

package
v0.0.0-...-5141842 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tree

type Tree[E constraints.Ordered] struct {
	// contains filtered or unexported fields
}

A loser tree is a binary tree laid out such that nodes N and N+1 have parent N/2. We store M leaf nodes in positions M...2M-1, and M-1 internal nodes in positions 1..M-1. Node 0 is a special node, containing the winner of the contest.

func New

func New[E constraints.Ordered](lists [][]E, maxVal E) *Tree[E]

func (*Tree[E]) Next

func (t *Tree[E]) Next() bool

func (*Tree[E]) Push

func (t *Tree[E]) Push(list []E)

Add a new list to the merge set

func (*Tree[E]) Winner

func (t *Tree[E]) Winner() E

Jump to

Keyboard shortcuts

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