listnode

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package listnode provides a set of tools for writing LeetCode problems locally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

The ListNode in this package can be used to declare the one in you package:

type ListNode = listnode.ListNode // type alias

func foo(head *ListNode) {}

func FromSlice added in v1.0.14

func FromSlice(s []int) *ListNode

Create a pointer of ListNode from a slice contains integer.

Refers to the problem Remove Linked List Elements: https://leetcode.com/problems/remove-linked-list-elements/.

We can follow the code below to create a ListNode from the slice:

listnode.FromSlice([]int{1, 2, 3, 4}) // *listnode.ListNode

Jump to

Keyboard shortcuts

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