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?
What will be an ideal response?
The interface of the List class was not changed—just its implementation. Therefore, the Queue class does not need to be changed other than changing the import state- ments to point to the different List class. The performance of the Queue will be ad- versely affected because adding to the end of the List is now linear in the number of elements instead of constant time.
You might also like to view...
A possible use for the Index method includes determining whether the area code "(312)"Â appears in a phone number.
Answer the following statement true (T) or false (F)
The keyboard keys or
move the insertion point ____.
A. one word to the left or right B. left or right one character C. to the beginning or the end of the line D. to the beginning or the end of the document
You choose desktop backgrounds and themes in the____________________ app.
Fill in the blank(s) with the appropriate word(s).
In IEEE terminology, a group of stations that share an access point are said to be part of which of the following?
a. extended service set b. basic service set c. modified service set d. generic service set