>*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.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004