list

package
v0.0.0-...-2d4ed79 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkedList

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

LinkedList 双向链表

func Make

func Make(vals ...interface{}) *LinkedList

func (*LinkedList) Add

func (list *LinkedList) Add(val interface{})

func (*LinkedList) Contains

func (list *LinkedList) Contains(val interface{}) bool

func (*LinkedList) ForEach

func (list *LinkedList) ForEach(consumer func(int, interface{}) bool)

ForEach 遍历链表中的每一个元素

func (*LinkedList) Get

func (list *LinkedList) Get(index int) (val interface{})

func (*LinkedList) Insert

func (list *LinkedList) Insert(index int, val interface{})

func (*LinkedList) Len

func (list *LinkedList) Len() int

func (*LinkedList) Range

func (list *LinkedList) Range(start, stop int) []interface{}

func (*LinkedList) Remove

func (list *LinkedList) Remove(index int) (val interface{})

func (*LinkedList) RemoveAllByVal

func (list *LinkedList) RemoveAllByVal(val interface{}) int

func (*LinkedList) RemoveByVal

func (list *LinkedList) RemoveByVal(val interface{}, count int) int

RemoveByVal 从前往后遍历比较并移除指定数量的节点

func (*LinkedList) RemoveLast

func (list *LinkedList) RemoveLast() (val interface{})

func (*LinkedList) ReverseRemoveByVal

func (list *LinkedList) ReverseRemoveByVal(val interface{}, count int) int

ReverseRemoveByVal 从后往前遍历比较并移除指定数量的节点

func (*LinkedList) Set

func (list *LinkedList) Set(index int, val interface{})

Jump to

Keyboard shortcuts

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