Write a function called void modifyQueue(Queue & q)

QUESTION 
Write a function called void modifyQueue(Queue<char> & q); where q is a queue of unique characters. The function should delete every other element of the queue. For example, if the queue contains:  a, b, c, d, e and f, then after the function has executed the queue should contain a,c and e.  You cannot access the private members of the queue, and the length of the queue is not available. You can only use functions that are part of the standard Queue ADT. Also, no other data structure is available to you except a constant number of temporary character variables.

SOLUTION


Comments

Popular Posts