Hey guys, I'm working on a program for my computer science class that is based on stacks and queues. Without going into too much detail of what the program is actually supposed to do (I think I understand the algorithm without issues), I just need some help on syntax for functions involving stacks and queues. The professor strongly suggested an array based stack and linked list based queues.
Basically I need to read data in and enqueue it into the first queue. Then I dequeue from there and enqueue into another queue. Our class basically has the functions posted for us.
int enqueue(struct queue* qPtr, int val);
This is where I'm unsure of how to change it. I think I'm supposed to do something like this when I call the function:
int enqueue(struct queue* qPtr, dequeue(struct queue2* qPtr));
Now, what I would like to know is if this is correct, do I need to call the dequeue function before the enqueue function or is calling the enqueue actually called dequeue as well?
Thanks so much for any help!