C program to print the information from each node in reverse order.

Write a C program to print the information from each node in reverse order in doubly linked list, in which pointer to last node is TAIL.

Questions by Nripen

Showing Answers 1 - 1 of 1 Answers

rajesh singh

  • May 4th, 2012
 

By recursion we can achieve this..

Code
  1. print(start)

  2. {

  3.         struct node* ptr;

  4.         ptr = start;

  5.         while(ptr != NULL)

  6.         {

  7.                  print(ptr);

  8.                  ptr = ptr->next;

  9.  

  10.          }

  11.          printf("%d     ",ptr->data);

  12.  

  13. }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions