Documentation ¶
Index ¶
- Constants
- Variables
- type Attribute
- type Change
- type Compare
- type Desc
- type GT
- type Option
- type Options
- func WithChange(change Change) Options
- func WithCompare(compare Compare) Options
- func WithFromHighToLow(fromHighToLow bool) Options
- func WithGT(gt GT) Options
- func WithHeadInsert(headInsert bool) Options
- func WithLimitSize(limitSize int) Options
- func WithMaxSize(maxSize int) Options
- func WithQueueType(smallHeap bool) Options
Constants ¶
View Source
const ( UINT_MIN uint32 = 0 // 无符号整型最小值 UINT_MAX uint32 = ^uint32(0) // 无符号整型最大值 INT_MAX = ^uint32(0) >> 1 // 有符号整型最大值 INT_MIX = ^INT_MAX // 有符号整型最小值 参考: https://blog.csdn.net/lishanleilixin/article/details/103269904 )
View Source
const ( // 技巧类 TwoPoint = "TwoPoint" // 双指针 Bisection = "Bisection" // 二分法 PreSum = "PreSum" // 前缀和 DiffArray = "DiffArray" // 差分数组 GapMulti = "GapMulti" // 间隔乘 Xor = "Xor" // 异或 Bit = "Bit" // 位运算 UnionFind = "UnionFind" // 并查集 PigeonCage = "PigeonCage" // 鸽笼原理 Cache = "Cache" // 综合类 - 可以使用到多种方式解决 SlidingWindow = "SlidingWindow" ReturnKMin = "ReturnKMin" // 数学类 Matrix = "Matrix" Graphical = "Graphical" // 图形计算 // 复杂边界类 Calculator = "Calculator" BigNumOpera = "BigNumOpera" // 大数操作(加、减、乘、除、合并) DigitalTrans = "DigitalTrans" // 人民币大小写转换 RedBlackTree = "RedBlackTree" )
技巧类 - 数据结构 - 算法 - 综合类 - 数学类 - 复杂边界类
View Source
const ( Sort = "Sort" Heap = "Heap" Stack = "Stack" EffectBrackets = "EffectBrackets" // 判断有效括号 MonotonousStack = "MonotonousStack" // 单调栈 MinStack = "MinStack" // 最小栈 Queue = "Queue" List = "List" StringCompare = "StringCompare" // 字符串对比算法 // 树、图、回溯专区 Recursion = "Recursion" Tree = "Tree" PreOrder = "PreOrder" // 先序遍历 PostOrder = "PostOrder" // 后续遍历 InOrder = "InOrder" // 中序遍历 Graph = "Graph" )
数据结构专题
View Source
const ( Dynamic = "Dynamic" // 动态规划 LIS = "LIS" // 最长递增子序列 Longest Increasing SubSequence LCS = "LCS" // 最长公共子序列 Longest Common Sequence LNS = "LNS" // 最长无重复子串 Longest NonRepeat SubSequence LMS = "LMS" // 最大子段乘积 Largest MultiOf SubSequence LMG = "LMG" // 最大间隔乘积 Largest MultiOf Gap LSG = "LSG" // 最大间隔和 Largest SumOf Gap LSS = "LSS" // 最大子段和 Largest SumOf SubSequence Greedy = "Greedy" // 贪心算法 BackTrack = "BackTrack" // 回溯(递归、剪枝) OptimalSchedule = "OptimalSchedule" // 调度 Permutation = "Permutation" // 排列 Combination = "Combination" //组合 PermuteAndCombine = "PermuteAndCombine" )
算法专题
Variables ¶
View Source
var ( ErrorNum = -9999 ErrorFloat = -9999.0 )
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
*
- @author ljfirst
- @version V1.0
- @date 2023/7/10 00:52
- @author-Email ljfirst@mail.ustc.edu.cn
- @blogURL https://blog.csdn.net/ljfirst
- @description *
type Compare ¶
type Compare func(interface{}, interface{}) bool
func ArrayCompare ¶
func ArrayCompare() Compare
type Desc ¶
type Desc struct { Name string `json:"name" common:"名称"` NameCn string `json:"name_cn" common:"中文名称"` Description string `json:"description" common:"题目描述"` Tips string `json:"tips" common:"解题思想"` ParamsDesc map[string]string `json:"params_desc" common:"参数描述,输入输出描述"` Example map[int]string `json:"example" common:"出入参示例"` }
type GT ¶
*
- @author ljfirst
- @version V1.0
- @date 2023/7/5 19:43
- @author-Email ljfirst@mail.ustc.edu.cn
- @blogURL https://blog.csdn.net/ljfirst
- @description *
var ArrayGT GT = func(arrayV interface{}, index1 int, index2 int) bool { value := reflect.ValueOf(arrayV) if value.Kind() != reflect.Array && value.Kind() != reflect.Slice { return false } if value.Len() <= index1 || value.Len() <= index2 { return false } array, ok := arrayV.([]int) if !ok { array1, ok1 := arrayV.([]interface{}) if !ok1 { return false } return array1[index1].(int) > array1[index2].(int) } return array[index1] > array[index2] }
type Option ¶
type Option struct { IsSmallHeap bool // 是否小顶堆 LimitSize int // 限制容量-不可以扩容 MaxSize int // 最大容量-可以扩容 FromHighToLow bool // true表示从高到低排序,默认 false 表示从低到高排序 HeadInsert bool // 头插法,默认false是尾插法 GT GT Change Change Compare Compare }
func NewOptions ¶
type Options ¶
type Options func(*Option)
*
- @author ljfirst
- @version V1.0
- @date 2023/7/4 21:23
- @author-Email ljfirst@mail.ustc.edu.cn
- @blogURL https://blog.csdn.net/ljfirst
- @description 优先队列 Option *
func WithChange ¶
func WithCompare ¶
func WithFromHighToLow ¶
func WithHeadInsert ¶
func WithLimitSize ¶
func WithMaxSize ¶
func WithQueueType ¶
Click to show internal directories.
Click to hide internal directories.