Documentation
¶
Index ¶
- func IsAdjoin[T num.Q](p, q *Node[T]) bool
- type Node
- func (this *Node[T]) DeepEqual(another *Node[T]) (equal bool)
- func (this *Node[T]) Get() (element T)
- func (this *Node[T]) InsertAsNext(e T) (xnode *Node[T])
- func (this *Node[T]) InsertAsPre(e T) (xnode *Node[T])
- func (this *Node[T]) InsertNodeAsNext(p *Node[T]) (xnode *Node[T])
- func (this *Node[T]) InsertNodeAsPre(p *Node[T]) (xnode *Node[T])
- func (this *Node[T]) IsBetween(p, q *Node[T]) bool
- func (this *Node[T]) MoveToAfter(targetNode *Node[T]) (xnode *Node[T])
- func (this *Node[T]) NextNode() *Node[T]
- func (this *Node[T]) PreNode() *Node[T]
- func (this *Node[T]) Put(e T) (element T)
- func (this *Node[T]) Remove() (element T)
- type Queue
- func (this *Queue[T]) Clear()
- func (this *Queue[T]) DeepEqual(another *Queue[T]) (equal bool)
- func (this *Queue[T]) Dequeue() (element T)
- func (this *Queue[T]) Enqueue(e T) *Node[T]
- func (this *Queue[T]) Front() (element T)
- func (this *Queue[T]) FrontNode() *Node[T]
- func (this *Queue[T]) IsEmpty() (isEmpty bool)
- func (this *Queue[T]) Size() int
- func (this *Queue[T]) String() (retString string)
- func (this *Queue[T]) ToSlice() (newSlice []T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
链表节点定义,下方代码直接从双向链表中复制
func FullNewNode ¶
节点完全构造,提供节点的所有信息进行构造 提示:不会修改参数中被指向的节点,调用方需要自行调整被指向节点的指针信息
func (*Node[T]) InsertAsNext ¶
元素 后插入算法,作为当前节点的直接后继插入,返回插入节点的地址
func (*Node[T]) InsertAsPre ¶
元素 前插入算法,作为当前节点的直接前驱插入,返回插入节点的地址 提示:可以在链表的头部插入,即使头部没有前驱节点
func (*Node[T]) InsertNodeAsNext ¶
节点 后插入算法,将节点p作为当前节点的直接后继插入,返回插入后的后继节点
func (*Node[T]) InsertNodeAsPre ¶
节点 前插入算法,将节点p作为当前节点的直接后继插入,返回插入后的前驱节点
func (*Node[T]) MoveToAfter ¶
节点移动,将本节点移动到节点p后方,返回移动后本节点的后继节点
Click to show internal directories.
Click to hide internal directories.