You are viewing a single comment's thread. Return to all comments →
if(head==NULL) { head->data=data; return head; }
here you are assigning data without allocating memory, it will crash.
Seems like cookies are disabled on this browser, please enable them to open this website
Inserting a Node Into a Sorted Doubly Linked List
You are viewing a single comment's thread. Return to all comments →
here you are assigning data without allocating memory, it will crash.