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.
Computer Science & Information Technology
You might also like to view...
The ________ displays above the selected picture and provides a way to rotate the image
A) alignment handle B) sizing handle C) picture handle D) rotation handle
Computer Science & Information Technology
When searching the web for job leads, it is best to stick to only a few key words
Indicate whether the statement is true or false
Computer Science & Information Technology