feat(queue): implement queue in golang code

This commit is contained in:
reanon
2022-11-29 01:10:22 +08:00
parent 27e4402eca
commit 76a7e0b232
4 changed files with 280 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// File: queue.go
// Created Time: 2022-11-29
// Author: Reanon (793584285@qq.com)
package chapter_stack_and_queue
type Queue interface {
// Offer 元素入队
Offer(num int)
// Peek 访问首元素
Peek() int
// Poll 元素出队
Poll() int
// Size 获取队列长度
Size() int
// IsEmpty 队列是否为空
IsEmpty() bool
}