Advertisement
nguyentruong98

Untitled

Dec 30th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. void pushQueue(Queue *q, int value)
  2. {
  3.       Node *newNode = makeNode(value);
  4.       if (q->head == NULL)
  5.       {
  6.             q->head->value = value;
  7.             return;
  8.       }
  9.       while (q->head != NULL)
  10.       {
  11.             q->head = q->head->next;
  12.       }
  13.       q->head->next->value = value;
  14.       return;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement