A.  In a main program create an object of the QueType class (You can get the header file/implementation code by following the link), and fill it with data from the file http://www.cs.csi.cuny.edu/~zelikovi/csc326/data/stackdata.htm

 

 

B. Given the following specification of a Front operation:

 

Function:  Returns a copy of the front element on the queue

Precondition: Queue is not empty

Postconditions: Function value = copy of the front item on the queue

                          Queue is not changed

 

a.  Write this function as client code, using the operations from the linked list implementation of the class.  Remember that the client has no access to the private members of the class. 

 

b.  Write this function as a new member of the QueType class.

 

c.   Test each of these functions.

 

 

C. Using only the algorithms in the Queue ADT,  write an algorithm called catQueue that concatenates two queues together.  The second queue should be at the end of the first queue. After concatenation the second queue should be empty. Then rewrite catQueue as a method  to be included in the Queue ADT.

 

To test these functions, create another queue, fill it with data, concatenate the two queues, and dequeue and print all items on the larger queue.