remove element queue
C
void enQueue(int value){
if (rear == SIZE - 1 && front == 0)
printf("the Queue its full!!!! \n");
else
{
if(front == -1)
front = 0;
//----------------------------------------
/* SOLUCION: Si ya recorrimos un item o sea que nuestro front sea mayor a 0,
y se nos lleno el Queue, ya no necesitamos el item, por lo tanto podremos
mover todos los valores una posicion atras y restar el front. si el
front es 0 no tendremos items recorridos asi que va estar full :D */
if (front > 0 && rear == SIZE - 1)
{
for (int i = 0; i < SIZE; i++)
{
items[i] = items[i + 1];
}
if (front > 0 && rear > 0)
{
front--;
rear--;
}
}
else
rear++;
//----------------------------------------
items[rear] = value;
printf("%d insert in the Queue :D \n", value);
}
}
Also in C:
- Title
- tkinter create_line
- Category
- C
- Title
- lazer codechef
- Category
- C
- Title
- set timezone in debian terminal
- Category
- C
- Title
- how to put a struct in another struct C
- Category
- C
- Title
- version of libgcc
- Category
- C
- Title
- pointer parameter where to put the asterix in C?
- Category
- C
- Title
- too few arguments to function in c
- Category
- C
- Title
- how to globally initlailize a struct
- Category
- C
- Title
- boolean function c
- Category
- C
- Title
- c program to perform transpose of a matrix
- Category
- C
- Title
- c fill 2d array
- Category
- C
- Title
- arduino knn
- Category
- C
- Title
- kadane's algorithm
- Category
- C
- Title
- compare two chars c
- Category
- C
- Title
- how to sleep in c
- Category
- C
- Title
- div
- Category
- C
- Title
- stack implementation
- Category
- C
- Title
- does strcat null terminate
- Category
- C
- Title
- es par
- Category
- C
- Title
- how to free memory in c
- Category
- C
- Title
- random en c
- Category
- C
- Title
- c check if array is empty
- Category
- C
- Title
- how to find the ith row of pascal's triangle in c
- Category
- C
- Title
- curl post request
- Category
- C
- Title
- azure storage emulator config
- Category
- C
- Title
- strcat in c
- Category
- C
- Title
- add border to image android
- Category
- C
- Title
- networkx remove attributes
- Category
- C
- Title
- reset style matplotlib
- Category
- C
- Title
- declare character array statically?
- Category
- C
- Title
- double return type in c
- Category
- C
- Title
- variadic function in c
- Category
- C
- Title
- command line arguments c
- Category
- C
- Title
- how to rebasde
- Category
- C
- Title
- c check if char is number
- Category
- C
- Title
- printf n characters c
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- c check if file was created
- Category
- C
- Title
- how to remove \n from a string c
- Category
- C
- Title
- docker run port mapping
- Category
- C
- Title
- \0 in c
- Category
- C
- Title
- hostbuilder add environment variables
- Category
- C
- Title
- how to change the mapping from jkil to wasd in vim
- Category
- C
- Title
- how to download file in powershell
- Category
- C
- Title
- sdl bouton
- Category
- C
- Title
- c bit access struct
- Category
- C
- Title
- sum of arrays
- Category
- C
- Title
- declaring a volatile in c
- Category
- C
- Title
- convert string to float c
- Category
- C
- Title
- c matrix sintax
- Category
- C
- Title
- measure time in c
- Category
- C
- Title
- how to put a char into a string c
- Category
- C
- Title
- msdos
- Category
- C
- Title
- v
- Category
- C
- Title
- get a remote branch git
- Category
- C
- Title
- how to do Employing defensive code in the UI to ensure that the current frame is the most top level window
- Category
- C
- Title
- write in a file using c
- Category
- C
- Title
- how to create an array of char in c++
- Category
- C
- Title
- heitai bestial
- Category
- C
- Title
- get regedit value cmd
- Category
- C
- Title
- bash: apt-add-repository: command not found
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- how to call the tkinter insert command from another class
- Category
- C
- Title
- es palindromo
- Category
- C
- Title
- File "h5py\h5g.pyx", line 161, in h5py.h5g.create ValueError: Unable to create group (name already exists)
- Category
- C
- Title
- c string concatenation with int
- Category
- C
- Title
- how can i remove a specific item from an array
- Category
- C
- Title
- c substring
- Category
- C
- Title
- mongodb delete all documents
- Category
- C
- Title
- mangoosejs
- Category
- C
- Title
- print variable c
- Category
- C
- Title
- limit of integer in c
- Category
- C
- Title
- pass the pointer in C
- Category
- C
- Title
- how to check where the last char is in a string c
- Category
- C
- Title
- fa fa-facebook
- Category
- C
- Title
- iterate through map
- Category
- C
- Title
- c vs python
- Category
- C
- Title
- switch case c
- Category
- C
- Title
- read a binary file c
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- where is my vimrc
- Category
- C
- Title
- es fibo
- Category
- C
- Title
- find gcd iteratively
- Category
- C
- Title
- what is the meaningof noremap
- Category
- C
- Title
- is c and c++ platform independent
- Category
- C
- Title
- doubly linked list c
- Category
- C
- Title
- c get first n characters of string
- Category
- C
- Title
- get configuration script window 7
- Category
- C
- Title
- declare integer c
- Category
- C
- Title
- how to get random numbers in c
- Category
- C
- Title
- c defined value sum
- Category
- C
- Title
- resto de division recursiva
- Category
- C
- Title
- code: 'EADDRINUSE', [0] errno: 'EADDRINUSE', [0] syscall: 'listen', [0] address: '::', [0] port: 5000
- Category
- C
- Title
- csrf_exempt
- Category
- C
- Title
- allocate memory c
- Category
- C
- Title
- vbnet create and write on file
- Category
- C
- Title
- xmlns='' was not expected
- Category
- C
- Title
- pop and push shows black screen which needs to be pressed back flutter
- Category
- C
- Title
- arduino millis()
- Category
- C
- Title
- left me on read
- Category
- C