Skip to content

Commit 24db575

Browse files
committed
feat: 연결 리스트 기반 큐 구현 시작
1 parent c7e5857 commit 24db575

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package queue;
2+
3+
public class LinkedListQueue<E> implements Queue<E> {
4+
5+
private int size;
6+
private Node<E> front;
7+
private Node<E> rear;
8+
9+
@Override
10+
public int size() {
11+
return this.size;
12+
}
13+
14+
@Override
15+
public boolean isEmpty() {
16+
return this.size == 0;
17+
}
18+
19+
@Override
20+
public void enqueue(E data) {
21+
22+
}
23+
24+
@Override
25+
public E dequeue() {
26+
return null;
27+
}
28+
29+
@Override
30+
public E peek() {
31+
return null;
32+
}
33+
34+
private static class Node<T> {
35+
36+
private T data;
37+
private Node<T> next;
38+
39+
public Node(T data) {
40+
this.data = data;
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)