structures

package
v0.0.0-...-9c1492e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List2Ints

func List2Ints(head *ListNode) []int

List2Ints convert List to []int

Types

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

ListNode 是链接节点 这个不能复制到*_test.go文件中。会导致Travis失败

func Ints2List

func Ints2List(nums []int) *ListNode

Ints2List convert []int to List

func Ints2ListWithCycle

func Ints2ListWithCycle(nums []int, pos int) *ListNode

Ints2ListWithCycle returns a list whose tail point to pos-indexed node head's index is 0 if pos = -1, no cycle

func (*ListNode) GetNodeWith

func (l *ListNode) GetNodeWith(val int) *ListNode

GetNodeWith returns the first node with val

func (*ListNode) PrintList

func (l *ListNode) PrintList()

Jump to

Keyboard shortcuts

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