Created
October 14, 2019 09:43
-
-
Save teramuza/6b1bd9f32fce10dcb9262b0c99461b59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define MAX 10 | |
using namespace std; | |
struct Queue { | |
int front, rear, counter, data[MAX]; | |
} Antrian; | |
void init() { | |
Antrian.rear = -1; | |
Antrian.front = 0; | |
Antrian.counter = 0; | |
} | |
bool isEmpty() { | |
return Antrian.counter == 0; | |
} | |
bool isFull() { | |
return Antrian.counter == MAX; | |
} | |
int circ(int val) { | |
return (val + 1) % MAX; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment