Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r100-stack/queue-of-integers
https://github.com/r100-stack/queue-of-integers
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/r100-stack/queue-of-integers
- Owner: r100-stack
- Created: 2020-09-30T03:17:47.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-30T03:18:11.000Z (over 4 years ago)
- Last Synced: 2025-01-01T07:08:00.404Z (26 days ago)
- Language: C
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Integer Queue
Basic implementation of an int queue.
## How to run the code (on Linux/Mac, use GitBash for Windows)
To compile the code
```
gcc -o ./executables/queue queue.c
```To run the code
```
./executables/queue
```## Cases
* To enqueue an int of value x, ```ENQUEUE x```
* To dequeue from the queue, ```DEQUEUE ```.
* To exit, ```EXIT ```.
The dummy variable can be any int value. This is because the code expects a string and an int at all times. An example of a dummy int is ```-1```.
## Sample Output
```
$ ./executables/queue
ENQUEUE 5
5
ENQUEUE 18
5 18
ENQUEUE 9
5 18 9
ENQUEUE 45
5 18 9 45
ENQUEUE 1
5 18 9 45 1
ENQUEUE 2
5 18 9 45 1 2
DEQUEUE -1
18 9 45 1 2
DEQUEUE -1
9 45 1 2
DEQUEUE -1
45 1 2
DEQUEUE -1
1 2
DEQUEUE -1
2
DEQUEUE -1EXIT -1
```