944,021 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1460
  • C RSS
Mar 4th, 2007
0

connect linked list

Expand Post »
I'm learning linked list. I have a question: How can I connect 2 linked list ? Thank you!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
donaldunca is offline Offline
27 posts
since Sep 2006
Mar 4th, 2007
0

Re: connect linked list

Go to the last node of the first list and attach the first node of the second list to it:
  1. last->next = list2;
If you have a doubly linked list, make sure the back pointer is updated:
  1. last->next = list2;
  2. list2->prev = last;
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Understring Position
Next Thread in C Forum Timeline: Rewriting strings using pointer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC