comparisonnetwork

package
v0.0.0-...-9f68131 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort[T any](cn *ComparisonNetwork, data []T, less func(i, j T) bool)

Types

type ComparisonNetwork

type ComparisonNetwork struct {
	Comparators []*comparator.Comparator
}

func Parse

func Parse(data string) (*ComparisonNetwork, error)

func (*ComparisonNetwork) IsSortingNetwork

func (cn *ComparisonNetwork) IsSortingNetwork() bool

IsSortingNetwork uses the zero-one principle to determine if this comparison network is a sorting network

func (*ComparisonNetwork) MaxInput

func (cn *ComparisonNetwork) MaxInput() int

func (*ComparisonNetwork) String

func (cn *ComparisonNetwork) String() string

func (*ComparisonNetwork) Svg

func (cn *ComparisonNetwork) Svg() string

Jump to

Keyboard shortcuts

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