Documentation
¶
Index ¶
- Constants
- type DoubleList
- func (list *DoubleList) AddNodeFromHead(n int, v string)
- func (list *DoubleList) AddNodeFromTail(n int, v string)
- func (list *DoubleList) IndexFromHead(n int) *DoubleNode
- func (list *DoubleList) IndexFromTail(n int) *DoubleNode
- func (list *DoubleList) PopFromHead(n int) *DoubleNode
- func (list *DoubleList) PopFromTail(n int) *DoubleNode
- func (list *DoubleList) PrintHead() (slice []string)
- func (list *DoubleList) PrintTail() (slice []string)
- type DoubleNode
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
Click to show internal directories.
Click to hide internal directories.