Array queue class

By arfanyoushuf ·
In this exercise the queue elements are to be rearranged so that all the zero elements are
placed at the end, without changing the order of non-zero elements.
Write a C# class with following three methods viz.
Public static void Main ( ) method,
Public static void Arrange (ref LinkedQueue q) method and
Public static void PrintQueue (LinkedQueue q) method.
The Main ( ) method should asks the user to input numbers with some zero and some non-zero numbers, terminated by -1 and store these numbers in a queue say Q. Note that -1 is not
to be stored in the queue.
Arrange ( ) method will rearrange the elements of the parameter queue, as mentioned above.
PrintQueue( ) method will print all elements of the parameter queue.
Important Note: You must use the LinkedQueue class

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums