Compile time error kindly check

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;
}


}

Hi Ishant,
Since the getNodeAt function throws exception you have to declare the reverse function that it throws exception.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.