Reverse( Node **head) {
Node *curr = *head;
Node *prev =NULL;
Node *next =*head;
while( curr !=NULL) {
next = curr->next;
curr->next = prev;
prev = curr;
curr = next;
}
*head = prev;
}
No comments:
Post a Comment