Linked list problems............................................
|
|---|
Reversing a linked list. Solutions...
| Sorted Insertion of a node into linked list. Solution...
| Deletion of node from linked list. Solution...
| Finding Nth element in a Linked List. Solution...
| | Binary search method. Solution... | | Generate mirror image tree of given tree. Solution... |
void DeleteList ( struct node** headRef ) { struct node* current = *headRef; // deref headRef to get the real head struct node* next; while (current != NULL) { next = current->next; // note the next pointer free(current); // delete the node current = next; // advance to the next node } *headRef = NULL; // Again, deref headRef to affect the real head back // in the caller. }
|