Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. void* cola_desencolar(cola_t *cola){
  2. if (cola_esta_vacia(cola) ){
  3. return NULL;
  4. }
  5.  
  6. if (cola->primero==cola->ultimo) {
  7. cola->ultimo=NULL;
  8. }
  9. nodo_t* aux =cola->primero;
  10. void* elem=aux->dato;
  11. cola->primero=aux->sig;
  12. free(aux);
  13. return elem;
  14. }
  15.  
  16. bool cola_esta_vacia(const cola_t *cola){
  17. if ((cola->primero==NULL) && (cola->ultimo==NULL) ) {
  18. return true;
  19. }
  20. return false;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement