We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
if(head->data <= data) {
head->next = SortedInsert(head->next, data);
// head->next->prev = head;
// The above line is not required as you are already setting that in the else if condition
}
Cookie support is required to access HackerRank
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 →
I have made a small change in your code.