donaricano-btn

큐(Queue) - 데큐 ArrayList(Double-ended queue (Decue using ArrayList))

- 일반 큐와 달리 데큐는 rear와 front에서 동시에 삽입 삭제가 이루어 질수 있다

- ArrayList를 사용하여 구현


1. ArrayList

1) 추가(add)

 

2) 삭제(remove)

 

3) 가져오기(get)

 


2. 구현 - ArrayList

1) 정의


- ArrayList 특성상 사이즈가 동적으로 증가한다, 그렇기 때문에 사이즈를 처음에 명시 하지 않아도 된다

- ArrayList 만 생성

2) insertFront(), insertRear()

 

3) removeFront(), removeRear()

 

4) peekFront(), peekRear()

 

5) main()

 

블로그 이미지

리딩리드

,
donaricano-btn

큐(Queue) - 동적 큐(DynamicQueue)

- 큐의 수용량이 초과 되면 자동으로 배열의 크기를 늘린다


1. 구현

1) 초기화


- 동적으로 늘어날 것을 감안하여 사이즈 지정

2) enQueue(), isQueueFull()

 

3) deQueue(), isQueueEmpty()

 

4) increaseCapacity()

 

5) main()

 



블로그 이미지

리딩리드

,
donaricano-btn

큐(Queue) - 간단큐예제(SimpleQueue) 


1. 구현

- enqueue : 요소를 삽입한다

- dequeue : 요소 추출한다

- FIFO(First In First Out)


1) 변수 초기화


2) enqueue(), isQueueFull()

 

3) dequeue(), isQueueEmpty()

 

블로그 이미지

리딩리드

,
donaricano-btn

스택(Stack) - 스택을 이용한 이진수변경(ConvertDecimalIntoBinary)

- 십 진수를 이진 수로 변경한다


1. DynamicStackImpl.class



2. ConvertDecimalIntoBinary.class

1) converter()

 

2) main()

 

블로그 이미지

리딩리드

,