mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
refactor: Replace poll with pop in Queue and Deque (#415)
This commit is contained in:
@ -26,8 +26,8 @@ public class queue {
|
||||
System.out.println("队首元素 peek = " + peek);
|
||||
|
||||
/* 元素出队 */
|
||||
int poll = queue.poll();
|
||||
System.out.println("出队元素 poll = " + poll + ",出队后 queue = " + queue);
|
||||
int pop = queue.poll();
|
||||
System.out.println("出队元素 pop = " + pop + ",出队后 queue = " + queue);
|
||||
|
||||
/* 获取队列的长度 */
|
||||
int size = queue.size();
|
||||
|
Reference in New Issue
Block a user