큐 (Queue) 먼저 넣은 데이터가 먼저 나오는 FIFO(First In First Out) 기반의 선형 자료 구조 구현 메서드 (method) 데이터 전체 획득/ 비어있는지 확인: Queue.getBuffer(), Deque.Queue.Empty() 데이터 추가/삭제: Queue.enqueue(), Queue.dequeue(); 첫번째 데이터/ 사이즈 /전체 삭제: Queue.front(), Queue.size(), Queue.clear() 📌 큐( Queue) 구현 소스 // Queue(): 생성자 함수로 초기 데이터 설정 function Queue(array) { this.array = array ? array : []; this.tail = array ? array.length : 0; this..
데크 (deque) Double-Ended Queue의 약자로 삽입과 삭제가 양쪽끝에서 모두 발생할 수 있는 선형 자료 구조 구현 메서드 (method) 데이터 전체 획득/ 비어있는지 확인: Deque.getBuffer(), Deque.isEmpty() 데이터 추가/삭제: Deque.pushFront(), Deque.popFront(), Deque.pushBack(), Deque.popBack() 첫번째 & 끝 데이터 반환/사이즈/ 전체삭제: Deque.front(), Deque.back(), Deque.size(), Deque.clear() 📌 데크 구현 소스 // Deque(): 초기 속성값 설정을 위한 생성자 함수 function Deque(array = []) { this.array = array..
원형큐 (Circular Queue) 원형 형태를 가지며, 먼저 넣은 데이터가 먼저 나오는 FIFO(First In First Out) 기반의 선형 자료 구조 구현 메서드 (method) 데이터 확인 method: CirqularQueue.isEmpty(), CircularQueue.isFull() 데이터 추가/삭제/반환: CirqularQueue.enqueue(), CircularQueue.dequeue(), CircularQueue.getBuffer() 첫번째 데이터/사이즈/전체 삭제: CirqularQueue.front(), CircularQueue.size(), CircularQueue.clear() 📌 원형큐 구현 소스 const DEFAULT_SIZE = 5; // CircularQueue()..
