Documentation
¶
Index ¶
- type IList
- type List
- type ListD
- func (l *ListD) Back() *NodeD
- func (l *ListD) Front() *NodeD
- func (l *ListD) Init() *ListD
- func (l *ListD) InsertAfter(n, target *NodeD)
- func (l *ListD) InsertBefore(n, target *NodeD)
- func (l *ListD) Len() int
- func (l *ListD) PushBack(n *NodeD)
- func (l *ListD) PushFront(n *NodeD)
- func (l *ListD) Remove(n *NodeD)
- func (l *ListD) Reverse()
- type ListDR
- func (l *ListDR) Back() *NodeDR
- func (l *ListDR) Front() *NodeDR
- func (l *ListDR) Init() *ListDR
- func (l *ListDR) InsertAfter(n, target *NodeDR)
- func (l *ListDR) InsertBefore(n, target *NodeDR)
- func (l *ListDR) Len() int
- func (l *ListDR) PushBack(n *NodeDR)
- func (l *ListDR) PushFront(n *NodeDR)
- func (l *ListDR) Remove(n *NodeDR)
- func (l *ListDR) Reverse()
- type Node
- type NodeD
- type NodeDR
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IList ¶
type IList interface { // read operations Len() int Front() *Node Back() *Node // write operations PushFront(*Node) PushBack(*Node) InsertBefore(n, target *Node) InsertAfter(n, target *Node) // delete operation Remove(*Node) // advance operations Reverse() }
IList defines the linked list interface
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) InsertAfter ¶
func (*List) InsertBefore ¶
type ListD ¶
type ListD struct {
// contains filtered or unexported fields
}
ListD defines a doubly linked list n <---> ... <--> n
func (*ListD) InsertAfter ¶
InsertAfter inserts the node after target
func (*ListD) InsertBefore ¶
InsertBefore inserts the node before target
type ListDR ¶
type ListDR struct {
// contains filtered or unexported fields
}
ListDR defines a doubly linked list implemented using ring
|-------------------------|
root <--> n <---> ... <--> n
func (*ListDR) InsertAfter ¶
InsertAfter inserts the node after target
|-n_new-| | |
... n <---> n_target <-x-> n <---> ...
func (*ListDR) InsertBefore ¶
InsertBefore inserts the node before target
|-n_new-| | |
... n <---> n <-x-> n_target <---> ...
func (*ListDR) PushBack ¶
PushBack inserts the node before root
|-----------------------------| |---------x----------| |
root <---> ... <---> n <---> n_new
func (*ListDR) PushFront ¶
PushFront inserts the node after root root <-x-> n <---> n <---> ...
| | |-n_new-|
type Node ¶
type Node struct { Data interface{} // contains filtered or unexported fields }
Node defines the node in a linked list
Click to show internal directories.
Click to hide internal directories.