1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Print the list in reverse order

Discussion in 'C' started by sandesh, Sep 17, 2007.

  1. sandesh

    sandesh New Member

    Joined:
    Sep 17, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hi.............
    we can reverse print the link list without changing the list
    we use recursion for this purpose ...............
    code is like..........

    Code:
    void printreverse(node *head)
    {
            if(head)
            {
                    printfreverse(head->next);
                    printf("  -> %d",head->data);
            }
    }
    if anyone of you have any query on queue ,stack and link list then we can discussion on that topics............
     
    Last edited by a moderator: Sep 17, 2007

Share This Page