6 lines
123 B
Python
6 lines
123 B
Python
|
|
def insert(anchor, new):
|
||
|
|
new.next = anchor.next
|
||
|
|
new.prev = anchor
|
||
|
|
anchor.next.prev = new
|
||
|
|
anchor.next = new
|