Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void* cola_desencolar(cola_t *cola){
- if (cola_esta_vacia(cola) ){
- return NULL;
- }
- if (cola->primero==cola->ultimo) {
- cola->ultimo=NULL;
- }
- nodo_t* aux =cola->primero;
- void* elem=aux->dato;
- cola->primero=aux->sig;
- free(aux);
- return elem;
- }
- bool cola_esta_vacia(const cola_t *cola){
- if ((cola->primero==NULL) && (cola->ultimo==NULL) ) {
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement