mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-01 20:12:07 +08:00
refactor: Replace poll with pop in Queue and Deque (#415)
This commit is contained in:
@ -29,8 +29,8 @@ public class queue
|
||||
Console.WriteLine("队首元素 peek = " + peek);
|
||||
|
||||
/* 元素出队 */
|
||||
int poll = queue.Dequeue();
|
||||
Console.WriteLine("出队元素 poll = " + poll + ",出队后 queue = " + String.Join(",", queue.ToArray()));
|
||||
int pop = queue.Dequeue();
|
||||
Console.WriteLine("出队元素 pop = " + pop + ",出队后 queue = " + String.Join(",", queue.ToArray()));
|
||||
|
||||
/* 获取队列的长度 */
|
||||
int size = queue.Count();
|
||||
|
||||
Reference in New Issue
Block a user