You are viewing a single comment's thread. Return to all comments →
try in c++
typedef struct Node *list; list Insert(list head,int data) { if(head==NULL){ head = new Node; head->next=NULL; head->data=data; return head; } return Insert(head->next,data); }
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a Node at the Tail of a Linked List
You are viewing a single comment's thread. Return to all comments →
try in c++
typedef struct Node *list; list Insert(list head,int data) { if(head==NULL){ head = new Node; head->next=NULL; head->data=data; return head; } return Insert(head->next,data); }