Documentation ¶
Index ¶
- type LinkedList
- func (l *LinkedList[T]) Append(e T)
- func (l *LinkedList[T]) Delete(e T)
- func (l *LinkedList[T]) DeleteNode(node *Node[T])
- func (l *LinkedList[T]) Exist(node *Node[T]) bool
- func (l *LinkedList[T]) GetNode(e T) *Node[T]
- func (l *LinkedList[T]) Insert(position int, e T) error
- func (l *LinkedList[T]) InsertAfterData(preData T, e T) error
- func (l *LinkedList[T]) InsertAfterNode(pre *Node[T], e T) error
- func (l *LinkedList[T]) InsertHead(e T)
- func (l *LinkedList[T]) IsEmpty() bool
- func (l *LinkedList[T]) Len() int
- func (q *LinkedList[T]) Pop() (T, bool)
- func (q *LinkedList[T]) Push(data T)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkedList ¶
type LinkedList[T comparable] struct { // contains filtered or unexported fields }
链表
func (*LinkedList[T]) InsertAfterData ¶
func (l *LinkedList[T]) InsertAfterData(preData T, e T) error
在第一次出现指定数据的结点后插入数据,若链表中无该数据,返回false
func (*LinkedList[T]) InsertAfterNode ¶
func (l *LinkedList[T]) InsertAfterNode(pre *Node[T], e T) error
在指定结点后面插入数据
func (*LinkedList[T]) Pop ¶ added in v0.2.0
func (q *LinkedList[T]) Pop() (T, bool)
func (*LinkedList[T]) Push ¶ added in v0.2.0
func (q *LinkedList[T]) Push(data T)
Click to show internal directories.
Click to hide internal directories.