SHARE
TWEET

Untitled

a guest Jun 16th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void reverseList(ListNode* startOfSec, ListNode *endOfSec){
  2.  
  3.     ListNode *prev = NULL;
  4.     ListNode *curr = startOfSec;
  5.     ListNode *nxt;
  6.     while(curr!=endOfSec->next){
  7.         nxt = curr->next;
  8.         curr->next = prev;
  9.         prev = curr;
  10.         curr = nxt;
  11.     }
  12. }
  13.  
  14. Callsite:
  15. //code to get start and end pointers
  16. reverseList(start, end);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top