nguyentruong98

Untitled

Nov 27th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. typedef struct Queue
  5. {
  6.       char Name[80], Phone[80], Email[80];
  7.       struct Node *head;
  8.       struct Node *next;
  9. } Queue;
  10. Node *front(Queue q);
  11. {
  12.       if (q.head == NULL)
  13.             return;
  14.       return q.head;
  15. }
  16. void pop(Queue *q)
  17. {
  18.       Node *tmp;
  19.       if (q.head == NULL)
  20.       {
  21.             printf("ERROR\n");
  22.             return;
  23.       }
  24.       Node *tmp = q.head;
  25.       q.head = q.head->next;
  26.       free(tmp);
  27. }
  28. void push(Queue *q)
  29. {
  30.       Node *iterator;
  31.       if (q.head == NULL)
  32.             return;
  33.       Node *iterator = q.head;
  34.       while (iterator->next != NULL)
  35.       {
  36.             iterator = iterator->next;
  37.       }
  38.       iterator->next = p;
  39.       return;
  40. }
  41. int main()
  42. {
  43.       return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment