leetcode

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqualTree

func DeepEqualTree(t *testing.T, head, right *TreeNode)

DeepEqualTree test recursion diff tree

func LoopEqualList

func LoopEqualList(t *testing.T, head *ListNode, list []int)

LoopEqualList test diff list and array

Types

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

ListNode Leetcode List Node

func GenerateList

func GenerateList(list []int) *ListNode

GenerateList generate leetcode list

type TreeNode

type TreeNode struct {
	Val   int
	Left  *TreeNode
	Right *TreeNode
}

TreeNode Leetcode Tree Node

func GenerateTree

func GenerateTree(treeList []interface{}) *TreeNode

* GenerateTree generate leetcode tree * e.g: []int{0, 1, 2, 2, 3, 3, nil, nil, 4, 4} * 1 * / \ * 2 2 * / \ * 3 3 * / \ * 4 4

Jump to

Keyboard shortcuts

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