Reference no: EM13348056
Problem 1. The Queue ADT
A queue is a fundamental abstract data type. It is an ordered collection of items in which the removal of items is restricted to the FIFO (rst in rst out) principle. That is, the rst item added to the queue will be the rst one removed, the second added will be the second removed, etc. The Queue ADT can be described as follows:
When you are standing in line waiting for a bank teller, you are in a queue of people. The rst in the line is the rst to be served (the rst to be removed from the queue). The next in line is the second to be served (or removed from the queue). Using this understanding of a queue, we will say that items added to a queue are added to the back of the queue (i.e., you go to the back of the line when you add yourself to the line). The word for adding an element to a queue is enqueue. When we remove an item for a queue, we remove it from the front of the queue (i.e., if you are next to be served in the line, you are at the front of the line). The word for removing an item from a queue is dequeue.
Note that front and back are just words that we use to understand what a queue is. It does not necessarily indicate how the data in the queue should be stored (or how the methods are implemented).
Write a Java class called PQueue that extends the provided abstract QueueADT class. Your class will implement a queue of people (objects of the provided Person class). Do not change the Person class or the QueueADT class.
Problem 2:
Draw a picture that reects, in some way, what you did on the long weekend and how it relates to COMP1006/1406 (or computer science in general). You can submit a hardcopy of your picture or you can electronically submit it in a pdf.
You will not be graded by artistic quality. The majority of the mark will simply be for submitting something. To receive full marks the drawing should have some relation to computer science.