Skip to content

Commit bfe6b69

Browse files
committed
Fix Queue using ArrayList
1 parent ed7b3c8 commit bfe6b69

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/alda/structure/queue/Queue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public T dequeue() {
4242
if (items.isEmpty()) {
4343
return null;
4444
}
45-
return items.removeLast();
45+
return items.removeFirst();
4646
}
4747

4848
/**

src/main/java/org/alda/structure/queue/array/QueueArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public T dequeue() {
4444
if (items.isEmpty()) {
4545
return null;
4646
}
47-
return items.removeLast();
47+
return items.removeFirst();
4848
}
4949

5050
/**

0 commit comments

Comments
 (0)