Write a function that DeleteCustomerList that deletes all th

Write a function that DeleteCustomerList that deletes all the nodes of the linked list starting from the last to the first using recursion. The function receives a pointer (Head) which points to the first node of the linked list as an argument.

Solution

Answer:

The function that DeleteCustomerList that deletes all the nodes of the linked list starting from last to the first using recursion is given as below :

void DeleteCustomerList(struct node** Head)
{
   if(Head == NULL)
   return ;
   else
   {
       DeleteCustomerList(Head->next);
       free(Head);
   }
}

 Write a function that DeleteCustomerList that deletes all the nodes of the linked list starting from the last to the first using recursion. The function receiv

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site