GeekInterview.com
Series: Subject: Topic:
Question: 10 of 246

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.
Asked by: Nripen | Member Since Mar-2012 | Asked on: Mar 29th, 2012

View all questions by Nripen

Showing Answers 1 - 1 of 1 Answers
rajesh singh

Answered On : 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. }

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.