queue

Please someone it's very urgent! Can you tell me how to reverse a queue? I mean I have two queues and I have to make a third one so that the first queue was there in the right and the second queue in a reversed order. I can't handle this,,,,

Thanks in advance
are you using std::queue ? if so #include <algorithm> and use them

for instance begin() and end() are appropriate for that task.

Read more about it.
actually I don't wanna use standard libraries, I'm a student and the whole work is done for learning. That's why I try to write everything by myself.
The concept is FIFO (first in first out) think of an arrow in----->out

push_back()
pop_front()

or push and pop

the hint behind begin() and end() is two pointers(within an iterator) you will simply swap them

thanks :) I have figured out another way too . It's by using recursion. And it works in a beautiful way I guess.
Topic archived. No new replies allowed.