how to combine two singly linked list inti one and print it?

This is a discussion on how to combine two singly linked list inti one and print it? within the C Programming forums, part of the General Programming Boards category; Sir, I have a problem with singly linked list. How to combine two singly linked list into one and print ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    5

    how to combine two singly linked list inti one and print it?

    Sir,

    I have a problem with singly linked list.

    How to combine two singly linked list into one and print it?

    Please give me some gidelines.

    Regards,

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    Append list 2 onto the end of list 1
    list1->tail->next = list2->head;


    Printing is far too easy to do. Give it a shot and post what you come up with.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21