Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
27 | 28 | 29 | 30 |
Tags
- selectc
- android studio
- unalias
- mysql
- solution
- function
- Join
- PORTG
- 파일존재
- Post
- Avr
- C++
- halliday
- Java
- 강좌
- array
- 현재언어
- 하이퍼 터미널
- is_array
- mathemetica
- 점점변하는값
- 0x
- Call
- SQL
- 월별 카운트
- application.mk
- cocos2d-x
- php
- 단축키
- Get
Archives
- Today
- Total
목록Queue (1)
코딩도사의 코드정리
Circular Queue 배열 구현 클래스
template class CircularQueue { private: Node* node; // 노드 배열 int capacity; // 큐의 용량 int front; // 전단의 인덱스 int rear; // 후단의 인덱스 public: CircularQueue(int capacity) { this->capacity = capacity + 1; // 노드 배열의 크기는 실제 용량에서 1을 더한 크기 (더미 공간 때문) node = new Node[this->capacity]; // Node 구조체 capacity + 1개를 메모리 공간에 할당한다 front = 0; rear = 0; // 전단과 후단의 초기화 } ~CircularQueue() { delete []node; // 노드 배열 소멸 } v..
컴퓨터 이야기/C++
2015. 12. 9. 06:00