public void reverse(int k){
// Write your code here
int m = this.size/k;
int initial=0;
int fin=m-1;
for(int i=0;i<k;i++){
int c=initial;
int d=fin;
while(c<d){
Node left = getNodeAt(c);
Node right = getNodeAt(d);
int temp=left.data;
left.data=right.data;
right.data=temp;
c++;
d--;
}
initial=initial+m;
fin=fin+m;
}
}