You are viewing a single comment's thread. Return to all comments →
node = DoublyLinkedListNode(data) if llist.data >= data: node.next = llist llist.prev = node return node head = llist while head.next: if head.next.data >= data: node.prev = head node.next = head.next head.next.prev = node head.next = node return llist head = head.next head.next = node node.prev = head return llist
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 →
**def sortedInsert(llist, data):