Question: Question 6 (10 marks) Programming with Data Structures: The API for the Queue class is given below. Constructor Summary Queue () Construct an empty Queue.

 Question 6 (10 marks) Programming with Data Structures: The API for

Question 6 (10 marks) Programming with Data Structures: The API for the Queue class is given below. Constructor Summary Queue () Construct an empty Queue. Method Summary dequeue () Remove and return the rst element in the Queue. Return null if the Queue is empty. void enqueue (Object item) Add the given item to the end of the Queue. The API for the Link class is given below. Constructor Summary Link () Construct a Link that can be used to make a linked list. The linked item and the next link will both be null. Link (Object item) Construct a L1nk w1th the linked item set to item. Link (Object item, Link next) Construct a Link with the linked item set to item, and the next Link set to next. Method Summary Object getDown () Returns the Object linked to this Link. Link getNext () Returns the next link for this Link. void setDown (Object item) Sets the item attached to this Link. void setNext (Link next) Sets the next link for this Link. Page 8 of 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!