Question: Assume you add this method to the class SinglyLinkedList: public void m 1 ( ) { Node tmp = head; while ( tmp ! =

Assume you add this method to the class SinglyLinkedList:
public void m1()
{
Node tmp = head;
while (tmp!=tail)
tmp=tmp.ggetNext();
}
If the list has 10 nodes, and you call this method, what will happen to the list?
Nothing
All the nodes in the list are removed except the first one.
All the nodes in the list are removed except the last one.
All the nodes in the list are removed.
Assume you add this method to the class

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!