Driver code
var head = null ; head = push ( head , 70 ) ; head = push ( head , 60 ) ; head = push ( head , 50 ) ; head = push ( head , 40 ) ; head = push ( head , 30 ) ; head = push ( head , 20 ) ; head = push ( head , 10 ) ; var tmp = head ; document . write ( " " ) ; while ( tmp != null ) { document . write ( tmp . data + " " ) ; tmp = tmp . next ; } document . write ( " " ) ; var m = 3 , n = 6 , k = 2 ; document . write ( " " ) ; rotateSubList ( head , m , n , k ) ;