Saturday, March 12, 2011

Linked list using recursion

//Untested
Q: How to print the linked list in reverse order

Data * TempData ;
TempData = HeadData;

Data * ReverseOrder(Data * TempData)
{

if(TempData)
{
ReverseOrder(TempData->next);
printf("%d",TempData->data);
}
else
{
printf("NULL \t");

}


}

No comments:

Post a Comment