1 Star 0 Fork 0

ljfirst/algo-go-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
StackINTF.go 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
ljfirst 提交于 2023-07-04 23:35 +08:00 . feat: PriorityQueue
package intf
import (
C "gitee.com/ljfirst/algo-go-sdk/common/constant"
"gitee.com/ljfirst/algo-go-sdk/src/data_structure/heap_stack_queue/stack"
"gitee.com/ljfirst/algo-go-sdk/src/data_structure/heap_stack_queue/stack/monotonousStack"
)
/**
* @author ljfirst
* @version V1.0
* @date 2023/6/25 20:55
* @author-Email ljfirst@mail.ustc.edu.cn
* @blogURL https://blog.csdn.net/ljfirst
* @description stack
* */
type StackINTF interface {
Push(interface{}) // push value in to stack
Pop() interface{} // pop value from stack
Peak() interface{} // get first value from stack
Resize() // extension the capacity of the stack
Empty() bool
Size() int
GetAttribute() *C.Attribute
}
// 最小栈 和 单调栈
type MinStackINTF interface {
StackINTF // grammar接口之间的继承关系
GetMin() int
GetAttribute() *C.Attribute
}
type MonotonousStackINTF interface {
NextValue([]int) []int
GetAttribute() *C.Attribute
}
var StackAssemble = map[string][]interface{}{
"Stack": {
&stack.ArrayStack{},
&stack.LinkedStack{},
&stack.QueueStack{}},
"MinStack": {&stack.MinStack{},
&stack.MinStackOpt{}},
"MonotonousStack": {&monotonousStack.DailyTemperatures{},
&monotonousStack.DailyTemperatures2{},
&monotonousStack.GetMinValueByRemoveK{},
&monotonousStack.MonotonousStack{}},
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ljfirst/algo-go-sdk.git
git@gitee.com:ljfirst/algo-go-sdk.git
ljfirst
algo-go-sdk
algo-go-sdk
v1.0.3

搜索帮助