mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-27 04:12:40 +08:00
fix(go): modify interface of stack, queue and deque
This commit is contained in:
@ -8,11 +8,13 @@ type Stack interface {
|
||||
// Push 元素入栈
|
||||
Push(num int)
|
||||
// Peek 访问栈顶元素
|
||||
Peek() int
|
||||
Peek() any
|
||||
// Pop 元素出栈
|
||||
Pop() int
|
||||
Pop() any
|
||||
// Size 栈的长度
|
||||
Size() int
|
||||
// IsEmpty 栈是否为空
|
||||
IsEmpty() bool
|
||||
// toString 栈输出为字符串
|
||||
toString() string
|
||||
}
|
||||
|
Reference in New Issue
Block a user