algorithms

package
v0.0.0-...-abf69a9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DpSequenceArrangements

func DpSequenceArrangements(sequence string, pieces []string) [][]string

func DpSequenceArrangementsCount

func DpSequenceArrangementsCount(sequence string, pieces []string) int

func DpSequenceCheck

func DpSequenceCheck(sequence string, pieces []string) bool

dpSequenceCheck uses dynamic programming to check if the passed `sequence` can be constructed with the `pieces` passed.

func FindMazePath

func FindMazePath(mat matrix.Matrix, start point.Point, end point.Point, wallValue int) (int, [][]point.Point)

func FloodFill

func FloodFill(mat matrix.Matrix, start point.Point) []point.Point

func LargestClique

func LargestClique(graph map[string]set.Set) set.Set

Types

type Corner

type Corner struct {
	point.Point
	CornerType CornerType
}

func GetCorners

func GetCorners(mat matrix.Matrix, region []point.Point) []Corner

ConvexTL - corner on bottom right A ?B BA

ConcaveTL - corner on bottom right A BA AA

type CornerType

type CornerType int
const (
	ConvexTL CornerType = iota
	ConvexTR
	ConvexBL
	ConvexBR
	ConcaveTL
	ConcaveTR
	ConcaveBL
	ConcaveBR
)

Jump to

Keyboard shortcuts

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