The removeFirst method of the SinglyLinkedList class includes a special case to reset the tail field to null when deleting

Question:

The removeFirst method of the SinglyLinkedList class includes a special case to reset the tail field to null when deleting the last node of a list (see lines 51 and 52 of Code Fragment 3.15). What are the consequences if we were to remove those two lines from the code? Explain why the class would or would not work with such a modification.

This problem has been solved!


Do you need an answer to a question different from the above? Ask your question!

Step by Step Answer:

Related Book For  answer-question

Data Structures and Algorithms in Java

ISBN: 978-1118771334

6th edition

Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

Question Details
Chapter # 3
Section: Exercises
Problem: 5
View Solution
Create a free account to access the answer
Cannot find your solution?
Post a FREE question now and get an answer within minutes. * Average response time.
Question Posted: December 12, 2018 12:46:25