COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
struct node { int data;struct node prev; struct node next;struct node link;};
|
|
struct node { int data;struct node next;};
|
|
struct node { int data;struct node prev; };
|
|
struct node { int data;struct node prev; struct node next;};
|
Detailed explanation-1: -In computer science, a doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains three fields: two link fields (references to the previous and to the next node in the sequence of nodes) and one data field.
Detailed explanation-2: -In C language, a linked list can be implemented using structure and pointers . struct LinkedList int data; struct LinkedList *next; ; The above definition is used to create every node in the list. The data field stores the element and the next is a pointer to store the address of the next node.
Detailed explanation-3: -A doubly linked list is declared as: struct Node int Value; struct Node *Fwd; struct Node *Bwd; ; Where Fwd and Bwd represent forward and backward link to the adjacent elements of the list.