Question Locked

Array queue class

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

1 reply

This discussion is closed to new replies.