Segregate Node Of Linkedlist Over Pivot Index
1. Given a singly linklist, Segregate Node of LinkedList over pivot index and return starting node of linkedlist.Input Format
2. pivot will be any random index in range of 0 to length Of Linkedlist
3. After segregation pivot Element should have to be present at correct position as in sorted linkedlist.
1->5->2->9->5->14->11->1->10->10->1->3->nullOutput Format
11
1->2->1->1->3->5->9->5->14->11->10->10->nullQuestion Video
-10^6 <= size Of LinkedList <= 10^6Sample Input
0 <= pivot Index <= 10^6
12Sample Output
1 5 2 9 5 14 11 1 10 10 1 3
7
1 1 1 5 2 9 5 14 11 10 10 3
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run