Replace poll with pop

This commit is contained in:
krahets
2023-03-13 22:39:45 +08:00
parent 28aacccf44
commit 516cb17775
6 changed files with 27 additions and 27 deletions

View File

@@ -70,7 +70,7 @@ func (q *arrayDeque) pushLast(num int) {
}
/* 队首出队 */
func (q *arrayDeque) pollFirst() any {
func (q *arrayDeque) popFirst() any {
num := q.peekFirst()
// 队首指针向后移动一位
q.front = q.index(q.front + 1)
@@ -79,7 +79,7 @@ func (q *arrayDeque) pollFirst() any {
}
/* 队尾出队 */
func (q *arrayDeque) pollLast() any {
func (q *arrayDeque) popLast() any {
num := q.peekLast()
q.queSize--
return num