You are viewing a single comment's thread. Return to all comments →
static DoublyLinkedListNode sortedInsert(DoublyLinkedListNode head, int data) { if (head == null) return new DoublyLinkedListNode(data); if(head.data > data) { DoublyLinkedListNode node = new DoublyLinkedListNode(data); node.next = head; return node; } head.next = sortedInsert(head.next, data); return head; }
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 →