Question: Given a singlyLinkedList 3 - > 5 - > 2 4 - > 1 5 - > 8 with a head reference refers to node

Given a singlyLinkedList 3->5->24->15->8 with a head reference refers to node 3. Show the linkedlist content after the following operations.
Node curr=head.next;
while(curr.next!=null){
curr=curr.next;
}
if(curr.item%3==0) curr.item=curr.item+head.item;
Node n = new Node(9, curr);
head.next = n;
show the list as: head->item1->item2->item3....

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 Databases Questions!