Reverse Node Of Linkedlist In K Group
1. Given a singly linklist, reverse the nodes of a linked list k at a time and return its modified linkedlist.Input Format
2. If number of nodes in multiple of k then it will reverse otherwise it will add inn the end of linkedlist without any change.
1->5->2->9->5->14->11->1->10->10->1->3->nullOutput Format
7
11->14->5->9->2->5->1->10->10->1->3->nullQuestion Video
1 <= size Of LinkedList <= 10^6Sample Input
0 <= k <= 10^6
12Sample Output
1 5 2 9 5 14 11 1 10 10 1 3
7
11 14 5 9 2 5 1 1 10 10 1 3
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run