Queue
-
[자료구조] Queue(큐)Mhwan's Study/Data Structure 2021. 1. 6. 00:42
# Queue (큐) First In First Out (FIFO)형태의 자료구조로, BFS탐색이나 버퍼 등에 사용된다. 기본적으로 rear와 front라는 포인터로 삽입할 곳과 뺄 곳을 가리키고 있음 (rear : enQueue (삽입)할 위치, front : deQueue(데이터 빼기)할 위치) 1. 기본적인 구현 front와 rear은 모두 초기에 -1로 시작한다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 public Queue { int[] queue; int rear = -1; int front = -1; public Queue(){ queue = new int[50]; } public void enQueue(in..