pop the stack and set q to the popped node

pop(&s,&q);