fix(go): modify interface of stack, queue and deque

This commit is contained in:
reanon
2022-11-29 10:42:09 +08:00
parent d32f15feb1
commit 19469aecbf
7 changed files with 32 additions and 27 deletions

View File

@ -6,13 +6,15 @@ package chapter_stack_and_queue
type Queue interface {
// Offer 元素入队
Offer(num int)
Offer(num any)
// Peek 访问首元素
Peek() int
Peek() any
// Poll 元素出队
Poll() int
Poll() any
// Size 获取队列长度
Size() int
// IsEmpty 队列是否为空
IsEmpty() bool
// toString 队列输出为字符串
toString() string
}