Documentation ¶
Index ¶
- Variables
- func Interval2Ints(i Interval) []int
- func IntervalSlice2Intss(is []Interval) [][]int
- func List2Ints(head *ListNode) []int
- func Points2Intss(points []Point) [][]int
- func Tree2Inorder(root *TreeNode) []int
- func Tree2Postorder(root *TreeNode) []int
- func Tree2Preorder(root *TreeNode) []int
- func Tree2ints(tn *TreeNode) []int
- type Interval
- type ListNode
- type Master
- type NestedInteger
- type PQ
- type Point
- type Queue
- type Stack
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
var NULL = -1 << 63
NULL 方便添加测试数据
Functions ¶
func IntervalSlice2Intss ¶
IntervalSlice2Intss 把 []Interval 转换成 [][]int
func Tree2Postorder ¶
Tree2Postorder 把 二叉树 转换成 postorder 的切片
Types ¶
type Interval ¶
Interval 提供区间表示
func Intss2IntervalSlice ¶
Intss2IntervalSlice 把 [][]int 转换成 []Interval
type ListNode ¶
ListNode 是链接节点 这个不能复制到*_test.go文件中。会导致Travis失败
func Ints2ListWithCycle ¶
Ints2ListWithCycle returns a list whose tail point to pos-indexed node head's index is 0 if pos = -1, no cycle
func (*ListNode) GetNodeWith ¶
GetNodeWith returns the first node with val
type NestedInteger ¶
type NestedInteger struct { Num int Ns []*NestedInteger }
NestedInteger is the interface that allows for creating nested lists. You should not implement it, or speculate about its implementation
func (*NestedInteger) Add ¶
func (n *NestedInteger) Add(elem NestedInteger)
Add Set this NestedInteger to hold a nested list and adds a nested integer to it.
func (NestedInteger) GetInteger ¶
func (n NestedInteger) GetInteger() int
GetInteger Return the single integer that this NestedInteger holds, if it holds a single integer The result is undefined if this NestedInteger holds a nested list So before calling this method, you should have a check
func (NestedInteger) GetList ¶
func (n NestedInteger) GetList() []*NestedInteger
GetList Return the nested list that this NestedInteger holds, if it holds a nested list The list length is zero if this NestedInteger holds a single integer You can access NestedInteger's List element directly if you want to modify it
func (NestedInteger) IsInteger ¶
func (n NestedInteger) IsInteger() bool
IsInteger Return true if this NestedInteger holds a single integer, rather than a nested list.
func (*NestedInteger) SetInteger ¶
func (n *NestedInteger) SetInteger(value int)
SetInteger Set this NestedInteger to hold a single integer.
type TreeNode ¶
TreeNode is tree's node
func GetTargetNode ¶
GetTargetNode 返回 Val = target 的 TreeNode root 中一定有 node.Val = target
func InPost2Tree ¶
InPost2Tree 把 inorder 和 postorder 切片转换成 二叉树
func PreIn2Tree ¶
PreIn2Tree 把 preorder 和 inorder 切片转换成 二叉树