Is it standard for a linked list node to have both previous and next pointers?
Code:struct node
{
int data;
struct node *prev;
struct node *next;
};
spoon_
Printable View
Is it standard for a linked list node to have both previous and next pointers?
Code:struct node
{
int data;
struct node *prev;
struct node *next;
};
spoon_
Having two pointers makes it easier to traverse and edit the list.
For most applications, a next pointer will suffice. Only when you need more complex navigation both are needed. Note that you don't have to have just those two. And you can also have multidimensional lists, just as in an array...
isn't a linked list with pointers next and previous a double-linked list?
Yes, it's a double-linked list.
Ahh, okay. A double linked list.
thanks,
spoon