answersLogoWhite

0


Best Answer

It's not that one is better than the other. They are used in different circumstances. A linear linked list is used like an array, with the added benefits of random insertion/removal of elements, etc. A circular linked list is often used as a buffer where one portion of the program produces data and another consumes it, such as in communications.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

16y ago

The biggest advantage of linked lists is that they can be expanded in constant time without memory overhead.

For example when you make an array you must allocate memory for a certain number of elements. If you want to add more elements to the array than you allocated for you must create a new array and copy the old array into the new array. This can take lots of time. You can prevent this by allocating lots of space initially but then you might allocate more than you need wasting memory.

With a linked list you can start with space for just one element allocated. And add on new elements easily without the need to do any copying and reallocating.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

advantages of linked lists are: 1.Memory utilization is very high in linked list.That is when user want another node then he will create.And the nodes in the list are not contigous.So the memory is greatly utilized. 2.Inserting or deleting nodes from a linked list is very easy at any place of the linked list. 3.And data can be dis-similar types.All the nodes need not have the same type of data. ravi.....

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

The primary advantage of a doubly linked list is that given a node in the list, one can navigate easily in either direction. This can be very useful, for example, if the list is storing strings, where the strings are lines in a text file (e.g., a text editor). One might store the ``current line'' that the user is on with a pointer to the appropriate node; if the user moves the cursor to the next or previous line, a single pointer operation can restore the current line to its proper value. Or, if the user moves back 10 lines, for example, one can perform 10 pointer operations (follow the chain) to get to the right line. For either of these operations, if the list is singly linked, one must start at the head of the list and traverse until the proper point is reached. This can be very inefficient for large lists. The primary advantage of a doubly linked list is that given a node in the list, one can navigate easily in either direction. This can be very useful, for example, if the list is storing strings, where the strings are lines in a text file (e.g., a text editor). One might store the ``current line'' that the user is on with a pointer to the appropriate node; if the user moves the cursor to the next or previous line, a single pointer operation can restore the current line to its proper value. Or, if the user moves back 10 lines, for example, one can perform 10 pointer operations (follow the chain) to get to the right line. For either of these operations, if the list is singly linked, one must start at the head of the list and traverse until the proper point is reached. This can be very inefficient for large lists.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

A singly-linked list only permits uni-directional traversal. A doubly-linked list permits bi-directional traversal. A singly-linked list has a 1-word per node memory overhead but a doubly-linked list has a 2-word per node overhead.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

in doubly linked list we can move forword or backword by using pointer , but this not in case of singly linked list ... :-)

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

A singly-linked list offers forward traversal only. A doubly-linked list offers bi-directional traversal.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

That is because it can be traversed in both forward and backward direction.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the advantage of doubly linked list over singly linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Educational Theory

What is the difference between doubly linked list and circular linked list?

A doubly linked list is a linked list in which each node knows where both of its neighbors are.A circular linked list is a linked list in which the "tail" of the list is linked to the "root". (Note that both the tail and root of the list are undefined/arbitrary in a circular linked list)Doubly linked lists are actually not necessarily related to circular linked list (aside from both being based on a linked list structure). In fact, you can have a circular doubly linked list, where each node knows where both of its neighbors are andwhere the list wraps around to connect to itself.


How do you implement a doubly linked list by using singly linked list?

Add another pointer to the nodes for the previous node: struct node { struct node *next; struct node *previous; void *data; }; typedef struct node node; Then change the logic for insertion and removal to make sure you set the previous pointer as well as the next one.


Common operation of singly linked list?

Create, destroy, add-element, find-element, delete-element.


what are the various operations in linked list which can be performed on linked list?

In linked list, there are various operations in linked list that you can perform on linked list, eg: adding new elements, deleting elements, getting the first element, getting the next element after an element, any many others.


What is heterogeneous linked list?

Heterogeneous Linked List is a linked list data-structure that contains or is capable of storing data for different datatypes.void pointer is basically used in these types of linked list as we are not sure of which type of data needs to be stored

Related questions

Convert single linked list to double linked list?

You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.


what are the differences between singly link list and doubly link list?

singly linked list stores only the address of next node while doubly linked list stores the address of previous node and next node and hence it is called doubly linked list. In singly linked list only forward traversing is possible while in doubly linked list forward and backward traversal is possible.


Traversing in Doubly Linked List is faster then Singly Linked List?

Traversing a doubly linked list is generally faster than traversing a singly linked list, but the speedup depends on how you do the traversal:Traversing from first to last node: No difference.Random access: Doubly linked list is faster, the difference is a fixed factor. (Like twice as fast. Which makes it still very slow for random access compared to arrays.)Reverse order: Doubly linked list is just as fast traversing "backwards" as "forwards", while a singly linked list traversing in reverse order needs to traverse the entire list once for every element in the list - it is a LOT slower. (Time complexity O(n) for doubly linked list, O(n*n) for singly linked, if you are familiar with the notation.)If you are talking about the computer science "big O notation", doubly linked and singly liked lists are the same. This is because the Big O notation ignores fixed factors and only looks at how time increases with the length of the list, and in this respect the two are the same. (Except for the special case of traversing the list in reverse order. Even here a singly linked list could do it in O(n) time - same as a doubly linked list - by reversing the list (O(n)) before traversing it (O(n)) for a total time of 2*O(n), which by the rules of Big O is the same as O(n).)


What is difference between linked list and singly linked list?

Answersingly linked list has the node inserted only at one end. and the pointer corresponds to the next pointer.but in a doubly linked list, the node pointer points to the both previous and the next node.singly linked list has two nodesdoubly linked list has three nodesA doubly linked list makes sense when you need to traverse the list in both directions. You aren't able to do that with a singly linked list.


What is a singly linked linear list?

A singly linked list is a linked list which only provides links in "one direction". Using a metaphor, a singly linked list is a one way street, while a doubly linked list is a two way street. Once you move forward in a singly linked list, there is no way to go backwards unless you kept your reference/pointer from before. A singly linked list would look like this: start ----> node1---->node2---->node3 ----> NULL You will see that node2 only has a link forward to node3 - it does not have a link backwards to node1, even though node1 has a link forwards to node2. To prevent us from permanently losing access to portions of the linked list, we generally keep a reference/pointer to "start". A doubly linked list would have twice the number of pointers/references as a singly linked list - making it very inefficient to store small datatypes. On the other hand, it would be possible to move both forwards and backwards with a doubly linked list because you have links pointing both forwards and backwards.


What is the advantage of doubly linked list over Doubly linked list?

A doubly linked list can be traversed in both directions (forward and backward). A singly linked list can only be traversed in one direction. A node on a doubly linked list may be deleted with little trouble, since we have pointers to the previous and next nodes. A node on a singly linked list cannot be removed unless we have the pointer to its predecessor. On the flip side however, a doubly linked list needs more operations while inserting or deleting and it needs more space (to store the extra pointer).


What is best and worst case of time complexity and space complexity of insert and delete operation in singly linked list doubly linked list?

When inserting or extracting at the end of a singly-linked list or at the beginning or end of a doubly-linked list, the complexity is constant time. Inserting or extracting in the middle of a list has linear complexity, with best case O(1) when the insertion or extraction point is already known in advance and a worst case of O(n) when it is not.


What is singly linked list and doubly linked list?

Singly Linked list Each item in the list is called a node and contains two fields  Information field - The information field holds the actual elements in the list  Next address field- The next address field contains the address of the next node in the list. The entire linked list is accessed from an external pointer called the List. Doubly linked list is a collection of node. Each node contains three fields an info field that contains the information stored in the node. The left and right field that contains the address of the node on its left and right. The doubly linked list could be linear, circular and may have a header node.


What operation is supported in constant time by the doubly linked list but not by the singly linked list?

examples:- delete this node (identified by a pointer)- insert a new node before this node- replace this node with another node


What are the differences between singly-linked doubly-linked and circularly-linked lists?

The difference is how many pointers each node has, and what they are pointing to. A linked list is comprised of "Nodes" each node contains data as well as 1 or more pointers. A singly linked list has one pointer per node, and a doubly linked list has 2 pointers per node. Some programs use several pointers per node. The purpose of these pointers is to hold the list together. In a singly linked list, you can view a node and can then move on to the next node that it is pointing to until you've passed through them all. A doubly-linked list would have a pointer to the next node as well as to the previous node. Thus you can move forward and backward through the list. A circularly-linked list doesn't necessarily have a set number of pointers because it simply means that the last node points to the first node creating a big circle. A non-circularly-linked list would not contain this last to first pointer and thus you would eventually reach the end of the list and stop.


How the pointer used in the linked list?

The pointer in linked list is used for traversing through the elements of the linked list. In a singly linked list, only a next pointer exits. So this pointer can be used for traversing only in one direction in the list. In case of a doubly linked list, a next and previous pointer exits. These pointers are used for traversing in both direction in the list.


What is the difference between doubly linked list and circular linked list?

A doubly linked list is a linked list in which each node knows where both of its neighbors are.A circular linked list is a linked list in which the "tail" of the list is linked to the "root". (Note that both the tail and root of the list are undefined/arbitrary in a circular linked list)Doubly linked lists are actually not necessarily related to circular linked list (aside from both being based on a linked list structure). In fact, you can have a circular doubly linked list, where each node knows where both of its neighbors are andwhere the list wraps around to connect to itself.