-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntQueue_P160_Q4.h
More file actions
54 lines (38 loc) · 932 Bytes
/
IntQueue_P160_Q4.h
File metadata and controls
54 lines (38 loc) · 932 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#ifndef ___IntQueue
#define ___IntQueue
typedef struct
{
int max; // 큐의 최대 용량
int num; // 현재의 요소 개수
int front; // 프런트
int rear; // 리어
int* que; // 큐 맨 앞 요소에 대한 포인터
}IntQueue;
// 큐 초기화
int Initialize(IntQueue* q, int max);
// 큐에 데이터를 인큐
int Enqueue(IntQueue* q, int x);
// 큐에 데이터를 디큐
int Dequeue(IntQueue* q, int* x);
// 큐에 데이터를 피크
int Peek(const IntQueue* q, int* x);
// 모든 데이터 삭제
void Clear(IntQueue* q);
// 큐의 최대 용량
int Capacity(const IntQueue* q);
// 큐에 저장된 데이터 개수
int Size(const IntQueue* q);
// 큐가 비어 있는가?
int IsEmpty(const IntQueue* q);
// 큐가 가득 찼는가?
int IsFull(const IntQueue* q);
// 큐에서 검색
int Search(const IntQueue* q, int x);
// 모든 데이터 출력
void Print(const IntQueue* q);
// 큐 종료
void Terminate(IntQueue* q);
// 임의의 데이터 검색
int Search2(const IntQueue* q, int x);
#endif