ring

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node[T any] struct {
	Value T
	Prev  *Node[T]
	Next  *Node[T]
}

func (*Node[T]) Format

func (n *Node[T]) Format() string

type Ring

type Ring[T any] struct {
	First      *Node[T]
	CheckValid bool
}

func New

func New[T any]() *Ring[T]

func (*Ring[T]) Dump

func (r *Ring[T]) Dump() string

func (*Ring[T]) EachNode

func (r *Ring[T]) EachNode(fnc func(n *Node[T]))

func (*Ring[T]) FindNode

func (r *Ring[T]) FindNode(match func(n *Node[T]) bool) (*Node[T], bool)

func (*Ring[T]) Insert

func (r *Ring[T]) Insert(v T) *Node[T]

func (*Ring[T]) InsertBefore

func (r *Ring[T]) InsertBefore(bn *Node[T], v T) *Node[T]

func (*Ring[T]) IsValid

func (r *Ring[T]) IsValid(n *Node[T]) bool

func (*Ring[T]) Remove

func (r *Ring[T]) Remove(rn *Node[T])

func (*Ring[T]) ShiftLeft

func (r *Ring[T]) ShiftLeft(n *Node[T])

func (*Ring[T]) ShiftRight

func (r *Ring[T]) ShiftRight(n *Node[T])

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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