Question: What is the output after calling the below method if SLL list contains these elements: 1 0 6 2 1 5 and item = 4

What is the output after calling the below method if SLL list contains these elements:
106215anditem =4
public voidMethod1(intitem, SingleLinkedListSLL)
{
if (SLL.isEmpty())
SLL.add (0, item);
else
SLL.add ( SLL.size()-2, item);
}
10624
1526104
1062415
1064215

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!