list

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OverLenErr = "index out"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DoubleList

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

func DoubleListInit

func DoubleListInit() *DoubleList

func (*DoubleList) AddNodeFromHead

func (list *DoubleList) AddNodeFromHead(n int, v string)

AddNodeFromHead 添加节点到链表头部的第N个元素之前,N=0表示新节点成为新的头部

func (*DoubleList) AddNodeFromTail

func (list *DoubleList) AddNodeFromTail(n int, v string)

AddNodeFromTail 添加节点到链表尾部的第N个元素之前,N=0表示新节点成为新的尾部

func (*DoubleList) IndexFromHead

func (list *DoubleList) IndexFromHead(n int) *DoubleNode

IndexFromHead 从头部开始某个位置获取列表节点,索引从0开始。

func (*DoubleList) IndexFromTail

func (list *DoubleList) IndexFromTail(n int) *DoubleNode

IndexFromTail 从头部开始某个位置获取列表节点,索引从0开始。

func (*DoubleList) PopFromHead

func (list *DoubleList) PopFromHead(n int) *DoubleNode

PopFromHead 从头部开始移除并返回第n个的节点

func (*DoubleList) PopFromTail

func (list *DoubleList) PopFromTail(n int) *DoubleNode

PopFromTail 从尾部开始移除并返回第n个节点

func (*DoubleList) PrintHead

func (list *DoubleList) PrintHead() (slice []string)

func (*DoubleList) PrintTail

func (list *DoubleList) PrintTail() (slice []string)

type DoubleNode

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

func (*DoubleNode) GetNext

func (node *DoubleNode) GetNext() *DoubleNode

func (*DoubleNode) GetPre

func (node *DoubleNode) GetPre() *DoubleNode

func (*DoubleNode) GetValue

func (node *DoubleNode) GetValue() string

func (*DoubleNode) HashNext

func (node *DoubleNode) HashNext() bool

func (*DoubleNode) HashPre

func (node *DoubleNode) HashPre() bool

func (*DoubleNode) IsNil

func (node *DoubleNode) IsNil() bool

Jump to

Keyboard shortcuts

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