Question: Given a singly linked list L, write the function to split the linked list into k groups of different size Example: Input: L: 1->3->2->5->6->7->4->9->13 Number

Given a singly linked list L, write the function to split the linked list into k groups of different size Example: Input: L: 1->3->2->5->6->7->4->9->13 Number of groups k = 3 Size of 1st group = 2, 2nd group = 3, 3rd group = 4 Output: L1: 1-> 3, L2: 2->5->6, L3: 7->4->9->13

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!