RosettaCodeData/Task/Doubly-linked-list-Element-insertion/Python/doubly-linked-list-element-insertion.py
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

5 lines
123 B
Python

def insert(anchor, new):
new.next = anchor.next
new.prev = anchor
anchor.next.prev = new
anchor.next = new