Driver code
int main ( ) { struct ListNode * head = NULL ; push ( & head , 70 ) ; push ( & head , 60 ) ; push ( & head , 50 ) ; push ( & head , 40 ) ; push ( & head , 30 ) ; push ( & head , 20 ) ; push ( & head , 10 ) ; ListNode * tmp = head ; cout << " Given ▁ List : ▁ " ; while ( tmp != NULL ) { cout << tmp -> data << " ▁ " ; tmp = tmp -> next ; } cout << endl ; int m = 3 , n = 6 , k = 2 ; cout << " After ▁ rotation ▁ of ▁ sublist : ▁ " ; rotateSubList ( head , m , n , k ) ; return 0 ; }