util

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphSeparators

func GraphSeparators[K comparable](inputs []K, edges func(K) []K) ([]K, [][]K)

func SeparatorsTest

func SeparatorsTest()

func StronglyConnectedComponents

func StronglyConnectedComponents[K comparable](inputs []K, edges func(K) []K) [][]K

func StronglyConnectedTest

func StronglyConnectedTest()

Types

type PriorityQueueT added in v0.1.10

type PriorityQueueT[T comparable] struct {
	// contains filtered or unexported fields
}

func MakePriorityQueue added in v0.1.10

func MakePriorityQueue[T comparable](less func(x T, y T) bool) *PriorityQueueT[T]

func (*PriorityQueueT[T]) Dequeue added in v0.1.10

func (pq *PriorityQueueT[T]) Dequeue() T

func (*PriorityQueueT[T]) Empty added in v0.1.10

func (pq *PriorityQueueT[T]) Empty() bool

func (*PriorityQueueT[T]) Enqueue added in v0.1.10

func (pq *PriorityQueueT[T]) Enqueue(x T)

func (*PriorityQueueT[T]) Len added in v0.1.10

func (pq *PriorityQueueT[T]) Len() int

func (*PriorityQueueT[T]) Peek added in v0.1.13

func (pq *PriorityQueueT[T]) Peek() T

func (*PriorityQueueT[T]) Update added in v0.1.13

func (pq *PriorityQueueT[T]) Update(value T)

type SExpKindT

type SExpKindT int
const (
	SExpInt SExpKindT = iota
	SExpSymbol
	SExpList
)

type SExpT

type SExpT struct {
	Kind    SExpKindT
	Integer int
	Symbol  string
	List    []*SExpT
}

func ParseSExp

func ParseSExp(data string) *SExpT

func (*SExpT) String

func (sexp *SExpT) String() string

type SetT

type SetT[E comparable] map[E]struct{}

func NewSet

func NewSet[E comparable](members ...E) SetT[E]

func (SetT[E]) Add

func (set SetT[E]) Add(members ...E)

func (SetT[E]) AddSet added in v0.1.18

func (set SetT[E]) AddSet(other SetT[E])

func (SetT[E]) Contains

func (set SetT[E]) Contains(member E) bool

func (SetT[E]) Difference

func (set SetT[E]) Difference(other SetT[E]) SetT[E]

func (SetT[E]) Intersection

func (set SetT[E]) Intersection(other SetT[E]) SetT[E]

func (SetT[E]) Members

func (set SetT[E]) Members() []E

func (SetT[E]) Pop

func (set SetT[E]) Pop() E

Removes one member of the set and returns it.

func (SetT[E]) Remove

func (set SetT[E]) Remove(member E)

func (SetT[E]) RemoveSet added in v0.1.18

func (set SetT[E]) RemoveSet(other SetT[E])

func (SetT[E]) Union

func (set SetT[E]) Union(other SetT[E]) SetT[E]

type StackT

type StackT[T any] struct {
	// contains filtered or unexported fields
}

func (*StackT[T]) Len

func (stack *StackT[T]) Len() int

func (*StackT[T]) Pop

func (stack *StackT[T]) Pop() T

func (*StackT[T]) Push

func (stack *StackT[T]) Push(elt T)

func (*StackT[T]) Ref added in v0.1.1

func (stack *StackT[T]) Ref(i int) T

func (*StackT[T]) Top

func (stack *StackT[T]) Top() T

Jump to

Keyboard shortcuts

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