Skip to main content

Posts

Showing posts from September, 2015

C Program To Implement Doubly Linked List.

Doubly-linked list is a more sophisticated form of linked list data structure. Each node contains two fields, called links that are references to the previous and to the next node in the sequence of nodes. The two node links allow traversal of the list in either direction. The previous link of the first node and the next link of the last node points to NULL. While adding or removing a node in a doubly linked list requires changing more links than the same operations on a singly linked list, the operations are simpler and potentially more efficient (for nodes other than first nodes) because there is no need to keep track of the previous node during traversal or no need to traverse the list to find the previous node, so that its link can be modified. Example: A doubly linked list whose nodes contain three fields of integer value, the link to the next node, and the link to the previous node.