Our linked-list implementation (Fig. 21.3) used both a firstNode and a lastNode. The lastNode was useful for

Question:

Our linked-list implementation (Fig. 21.3) used both a firstNode and a lastNode. The lastNode was useful for the insertAtBack and removeFrom- Back methods of the List class. The insertAtBack method corresponds to the enqueue method of the Queue class. Rewrite the List class so that it does not use a lastNode. Thus, any operations on the tail of a list must begin searching the list from the front. Does this affect our implementation of the Queue class (Fig. 21.11)?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Java How To Program Early Objects

ISBN: 9780134743356

11th Edition

Authors: Paul Deitel, Harvey Deitel

Question Posted: