public static ListNode reverseBetween(ListNode head, int m, int n) { ListNode pre=head,current=head,mPre = new ListNode(0),mNode = new ListNode(0),nNode = new ListNode(0),temp; mPre.next=head; int i=1; while(i<=n) { if(i==m-1) mPre=current; if(i==m)…