mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
refactor: Replace poll with pop in Queue and Deque (#415)
This commit is contained in:
@@ -47,7 +47,7 @@ func (q *arrayQueue) push(num int) {
|
||||
}
|
||||
|
||||
/* 出队 */
|
||||
func (q *arrayQueue) poll() any {
|
||||
func (q *arrayQueue) pop() any {
|
||||
num := q.peek()
|
||||
// 队首指针向后移动一位,若越过尾部则返回到数组头部
|
||||
q.front = (q.front + 1) % q.queCapacity
|
||||
|
||||
Reference in New Issue
Block a user