Submitted Questions

  • 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.

    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. }