cycle

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCycleDetected = errors.New("cycle detected")

ErrCycleDetected is error triggered when was cycle detected.

Functions

This section is empty.

Types

type Cycle

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

Cycle is cycle checker.

func New

func New() *Cycle

New is cycle constructor.

func (*Cycle) Add

func (c *Cycle) Add(key int) error

Add checks if same def id already exist and return error or mark item as visited.

func (*Cycle) Del

func (c *Cycle) Del(key int)

Del remove item.

func (*Cycle) Stack

func (c *Cycle) Stack() []int

Jump to

Keyboard shortcuts

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