static void _inPlaceRev( Node *cursor, Node *prev) {
  if(!cursor) { 
    return;
  }
  _inPlaceRev(head, tail, cursor->next, cursor);
  cursor->next = prev;
}
static void inPlaceRev(LinkedList * _my) {
  _inPlaceRev(_my->head, NULL);
_my->head ^= _my->tail;
_my->tail ^= _my->head;
_my->head ^= _my->tail;
}
 
No comments:
Post a Comment