internal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package internal holds shared helpers used across the pkg packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

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

Chain ...

func (*Chain[T]) Append

func (c *Chain[T]) Append(node *ChainLink[T])

Append ... time: O(1); mem: O(1)

func (*Chain[T]) GetHead

func (c *Chain[T]) GetHead() *ChainLink[T]

GetHead ... time: O(1); mem: O(1)

func (*Chain[T]) Iter

func (c *Chain[T]) Iter() func(func(int, T) bool)

Iter iteration on chain

Example:

m := Chain[int, string]()
for i, v := range m.Iter() {
	fmt.Println(i,v)
}

func (*Chain[T]) Len

func (c *Chain[T]) Len() int

Len ... time: O(1); mem: O(1)

func (*Chain[T]) Remove

func (c *Chain[T]) Remove(node *ChainLink[T])

Remove ... time: O(1); mem: O(1)

type ChainLink[T any] struct {
	Val  T
	Prev *ChainLink[T]
	Next *ChainLink[T]
}

ChainLink ...

Jump to

Keyboard shortcuts

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