problemset

package
v0.0.0-...-67fb0f9 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Difference

type Difference struct {
	// contains filtered or unexported fields
}

差分数组工具类

func NewDifference

func NewDifference(nums []int) *Difference

func (*Difference) Increment

func (d *Difference) Increment(i, j, val int)

给闭区间 [i, j] 增加 val(可以是负数)

func (*Difference) Result

func (d *Difference) Result() []int

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

type MapSum

type MapSum struct {
	// contains filtered or unexported fields
}

func Constructor

func Constructor() MapSum

func (*MapSum) Insert

func (this *MapSum) Insert(key string, val int)

func (*MapSum) Sum

func (this *MapSum) Sum(prefix string) int

type No519Solution

type No519Solution struct {
	// contains filtered or unexported fields
}

func No519Constructor

func No519Constructor(m int, n int) No519Solution

func (*No519Solution) Flip

func (this *No519Solution) Flip() []int

func (*No519Solution) Reset

func (this *No519Solution) Reset()

type Node

type Node struct {
	Val      int
	Children []*Node
}

type Node116

type Node116 struct {
	Val   int
	Left  *Node116
	Right *Node116
	Next  *Node116
}

type NumArray

type NumArray struct {
	// contains filtered or unexported fields
}

func ConstructorNO303

func ConstructorNO303(nums []int) NumArray

func (*NumArray) SumRange

func (this *NumArray) SumRange(left int, right int) int

type NumArray307

type NumArray307 struct {
	// contains filtered or unexported fields
}

func Constructor307

func Constructor307(nums []int) NumArray307

func (*NumArray307) SumRange

func (this *NumArray307) SumRange(left int, right int) int

func (*NumArray307) Update

func (this *NumArray307) Update(index int, val int)

type NumMatrix

type NumMatrix struct {
	// contains filtered or unexported fields
}

func ConstructorLCR013

func ConstructorLCR013(matrix [][]int) NumMatrix

func ConstructorNo304

func ConstructorNo304(matrix [][]int) NumMatrix

func (*NumMatrix) SumRegion

func (this *NumMatrix) SumRegion(row1 int, col1 int, row2 int, col2 int) int

type NumMatrixLCR013

type NumMatrixLCR013 struct {
	// contains filtered or unexported fields
}

func (*NumMatrixLCR013) SumRegion

func (this *NumMatrixLCR013) SumRegion(row1 int, col1 int, row2 int, col2 int) int

type PriorityQueue

type PriorityQueue []*ListNode

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type Solution

type Solution struct {
	// contains filtered or unexported fields
}

func Constructor384

func Constructor384(nums []int) Solution

func (*Solution) Reset

func (this *Solution) Reset() []int

func (*Solution) Shuffle

func (this *Solution) Shuffle() []int

type TreeNode

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

type UF

type UF struct {
	// contains filtered or unexported fields
}

func NewUF

func NewUF(n int) *UF

func (*UF) Connected

func (u *UF) Connected(p, q int) bool

判断节点 p 和节点 q 是否连通

func (*UF) Count

func (u *UF) Count() int

返回图中的连通分量个数

func (*UF) Find

func (u *UF) Find(x int) int

func (*UF) Union

func (u *UF) Union(p, q int)

将节点 p 和节点 q 连通

Jump to

Keyboard shortcuts

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