954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

qustion about the double link list

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

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

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

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

thanks narue you mean that in stack we prefer to use the single
but in the qeue we use the double

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

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.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 

thanks

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

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You