auto commit
This commit is contained in:
parent
4012e90b67
commit
1085339936
@ -302,9 +302,11 @@ public class Queue<Item> {
|
||||
|
||||
// 出队列
|
||||
public Item dequeue() {
|
||||
if (isEmpty()) return null;
|
||||
Node node = first;
|
||||
first = first.next;
|
||||
N--;
|
||||
if (isEmpty()) last = null;
|
||||
return node.item;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user