null
to indicate the end of the list.Copy Codestruct Node {
int data;
struct Node* next;
};
null
, and the last node's next pointer is set to null
.Copy Codestruct Node {
int data;
struct Node* prev;
struct Node* next;
};