link

package
v0.0.0-...-b556d9d Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenTwoIntersectLink(a int, b int, c int) (*SingleLinkedList[int], *SingleLinkedList[int])

Types

type MyArray

type MyArray struct {
	List []int
	Len  int
	Cap  int
}

func NewMyArray

func NewMyArray(cap int) *MyArray

func (*MyArray) Del

func (ma *MyArray) Del(pos int)

func (*MyArray) Get

func (ma *MyArray) Get(pos int) int

func (*MyArray) Insert

func (ma *MyArray) Insert(value int, pos int)

type Node

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

func NewNode

func NewNode[T comparable](v T) *Node[T]

func (*Node[T]) Next

func (n *Node[T]) Next() *Node[T]

func (*Node[T]) SetNext

func (n *Node[T]) SetNext(next *Node[T]) *Node[T]

func (*Node[T]) SetValue

func (n *Node[T]) SetValue(v T)

func (*Node[T]) Value

func (n *Node[T]) Value() T

type SingleLinkedList

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

func NewSingleLinkedList

func NewSingleLinkedList[T comparable]() *SingleLinkedList[T]

func (*SingleLinkedList[T]) Add

func (sl *SingleLinkedList[T]) Add(v T)

func (*SingleLinkedList[T]) Del

func (sl *SingleLinkedList[T]) Del(v T)

func (*SingleLinkedList[T]) Empty

func (sl *SingleLinkedList[T]) Empty() bool

func (*SingleLinkedList[T]) Head

func (sl *SingleLinkedList[T]) Head() *Node[T]

func (*SingleLinkedList[T]) Merge

func (sl *SingleLinkedList[T]) Merge(al *SingleLinkedList[T])

func (*SingleLinkedList[T]) Print

func (sl *SingleLinkedList[T]) Print()

func (*SingleLinkedList[T]) Seek

func (sl *SingleLinkedList[T]) Seek(v T) (pre *Node[T], now *Node[T])

type Stack

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

func NewStack

func NewStack[T any](cap uint) *Stack[T]

func (*Stack[T]) Empty

func (s *Stack[T]) Empty() bool

func (*Stack[T]) Full

func (s *Stack[T]) Full() bool

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() (T, error)

func (*Stack[T]) Push

func (s *Stack[T]) Push(v T) error

type StackErrEmpty

type StackErrEmpty error

type StackErrFull

type StackErrFull error

Jump to

Keyboard shortcuts

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