Question: (Java) Given a pointer to a singly linked list write a routine which will create 2 new lists, in addition to the original. The 1st

(Java)

(Java) Given a pointer to a singly linked list write a routine

Given a pointer to a singly linked list write a routine which will create 2 new lists, in addition to the original. The 1st new list should contain every 3rd node starting from the second node in the list and the second new list should contain every 3rd node from the 3rd node in the list. This means when you are done you will have 3 lists the original list which will contain (keep) nodes 1 and 4 and 7 etc from the original list, the 2nd list will contain nodes 2 and 5 and 8 etc. and the 3rd list will contain nodes 3 and 6 and 9 etc from the original list. When you are finished you will have 3 separate singly linked lists

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!