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]) GetLength() int
- 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]) PrintInfo()
- 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
在指定结点后面插入数据
Click to show internal directories.
Click to hide internal directories.