944,172 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3005
  • C RSS
Mar 15th, 2006
0

qustion about the double link list

Expand Post »
hi every 1
i wanna to ask about sigl and double linked list
*what is the advanyages and desadvantegs of the double linke list

*when we use the double and when we use the single


thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005
Mar 15th, 2006
0

Re: qustion about the double link list

>*what is the advanyages and desadvantegs of the double linke list
Is this homework? A double linked list allows you to move foward and backward, thus simplifying and optimizing some operations. However, the maintenance of the extra pointer complicates the algorithms.

>*when we use the double and when we use the single
It's largely a matter of taste. I know people who only use double linked lists even when they're overkill. In general, if you use the operations that a double linked list will make easier or faster, you should at least consider using one. Otherwise, why bother? If I write a simple linked stack, I'm not going to waste my time with the extra pointer because it's not necessary. But if I'm writing a simple linked deque, double linking makes sense.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 15th, 2006
0

Re: qustion about the double link list

thanks narue you mean that in stack we prefer to use the single
but in the qeue we use the double
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005
Mar 15th, 2006
0

Re: qustion about the double link list

A singly linked list can be used to create a stack, but so could a doubly linked. It depends what you are most comfortable with.

A queue and a deque are different containers. A queue removes the first item pushed on the queue, whereas a deque can remove either the first or the last item pushed onto the deque. Again a singly linked list or a doubly linked list could be used with either container. It depends on how comfortable you are using one or the other. I can't think of any manipulation of data you can do with a singly linked list you can't do with a doubly linked or visa versa. It's ease of the manipulation and ease of implementation that counts. If you are familiar with doubly linked lists, then some process are easier to implement using that container than singly linked, but the syntax of working with doubly linked lists is a little trickier to work with than singly, so if you are familiar and comfortable with singly linked use it. However, you will want to become familiar with doubly linked because it can make your life easier under some circumstances.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Lerner is offline Offline
2,253 posts
since Jul 2005
Mar 16th, 2006
0

Re: qustion about the double link list

thanks
Reputation Points: 10
Solved Threads: 0
Junior Poster
some one is offline Offline
129 posts
since Apr 2005

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: can't delete single chars in a string
Next Thread in C Forum Timeline: A Simple Calculator





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


Follow us on Twitter


© 2011 DaniWeb® LLC