lists

package
v0.0.0-...-712194a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkedList

type LinkedList struct {
	Data interface{}
	Next *LinkedList
}

func NewLinkedList

func NewLinkedList() *LinkedList

func RecursiveReverse

func RecursiveReverse(head *LinkedList) *LinkedList

RecursiveReverse 递归调用反转 n - 1 子链

func (*LinkedList) Append

func (l *LinkedList) Append(node *LinkedList)

func (*LinkedList) GenerateLinkedList

func (l *LinkedList) GenerateLinkedList(len int)

func (*LinkedList) HasCycle

func (l *LinkedList) HasCycle() bool

HasCycle 通过快慢指针判断链表是否有环

func (*LinkedList) Insert

func (l *LinkedList) Insert(node *LinkedList)

func (*LinkedList) PrintLindedList

func (l *LinkedList) PrintLindedList()

func (*LinkedList) Reverse

func (l *LinkedList) Reverse()

func (*LinkedList) SwapPairs

func (l *LinkedList) SwapPairs()

SwapPairs 链表交换相临节点

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL