Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void add_in_back(Queue *q, int x){
- node *p = (node*) malloc(sizeof(node));
- p->data = x;
- p->next = NULL;
- if (!isempty(q)){
- p->pre = q->tail;
- (q->tail)->next=p;
- }else{
- p->pre = NULL;
- q->head=p;
- }
- q->tail = p;
- }
Advertisement
Add Comment
Please, Sign In to add comment