Skip to content

Commit 9844494

Browse files
committed
feat: Array 기반 원형 큐 예제 코드 구현
1 parent facb12d commit 9844494

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

.idea/.gitignore

-2
This file was deleted.

.idea/misc.xml

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package queue;
2+
3+
public class ArrayQueue<E> implements Queue<E> {
4+
5+
private static final int INITIAL_CAPACITY = 100;
6+
7+
private int front;
8+
private int rear;
9+
private int size;
10+
private Object[] queueArray;
11+
12+
public ArrayQueue() {
13+
queueArray = new Object[INITIAL_CAPACITY];
14+
}
15+
16+
@Override
17+
public int size() {
18+
return this.size;
19+
}
20+
21+
@Override
22+
public boolean isEmpty() {
23+
return this.size == 0;
24+
}
25+
26+
@Override
27+
public void enqueue(E data) {
28+
29+
}
30+
31+
@Override
32+
public E dequeue() {
33+
return null;
34+
}
35+
36+
@Override
37+
public E peek() {
38+
return null;
39+
}
40+
}

0 commit comments

Comments
 (0)