This function rotates a linked list counter - clockwise and updates the head . The function assumes that k is smaller than size of linked list .
void rotate ( Node * * head_ref , int k ) { if ( k == 0 ) return ;