need help!!! exchange 1st and 2nd elements at the front of a queue

Hi, I got stuck while writing the code for exchanging first and second elements at front of the queue.This is how I considered: there are 2 elemnts with 2 bool flags set and I deleted these elements from front and then added from the rear by swapping the order of it and also I checked queue empty case after removing elements from queue, then I got stuck with it.

My question is how should I move till end(front) of queue to place exchanged elements.

Any help is greatly appreciated!!!!
Topic archived. No new replies allowed.