반응형
    
    
    
  # Stack
- Last in First Out
- 스택은 ArrayList로 구현
Stack<Integer> st = new Stack<>();
st.push('10');
st.push('20');
st.push('30');
while(!st.empty()){
	System.out.println(st.pop());
}
# Queue
- First in First Out
- 큐는 LinkedList로 구현
Queue<Integer> q = new LinkedList<>();
q.offer('10');
q.offer('20');
q.offer('30');
while(!q.isEmpty()){
	System.out.println(q.poll());
}
- 큐를 ArrayDeque로 구현
Queue<Integer> q = new ArrayDeque<>();
q.add('10');
q.add('20');
q.add('30');
While(!q.isEmpty()){
	System.out.println(q.poll());
}

# Deque(Double-Ended Queue)

반응형
    
    
    
  '④ IT 스타트 (IT Competence) > Application' 카테고리의 다른 글
| [java] Array(배열) (0) | 2021.09.05 | 
|---|---|
| [java] Array, List(ArrayList, LinkedList) (0) | 2021.09.04 | 
| [java] Primitive와 Reference Type (0) | 2021.09.04 | 
| [js] JavaScript Tutorial (0) | 2021.08.27 | 
| 브라우저 SHA-1 인증서 발급 중단 (0) | 2016.06.11 |