Doubly-linked list/Element insertion: Difference between revisions
Content added Content deleted
m (→[[Doubly-linked_list/Element_insertion#ALGOL 68]]: fix spelling) |
m (→[[Doubly-linked_list/Element_insertion#ALGOL 68]]: add "insert before" routine) |
||
Line 66: | Line 66: | ||
); |
); |
||
# BEGIN rosettacode task |
# BEGIN rosettacode task specimen code: |
||
can |
can handle insert both before the first, and after the last link # |
||
PROC insert after = (REF LINK #self,# prev, DATA new data)LINK: ( |
PROC insert after = (REF LINK #self,# prev, DATA new data)LINK: ( |
||
# DOWN do link OF splice OF self; to make thread safe # |
# DOWN do link OF splice OF self; to make thread safe # |
||
Line 76: | Line 77: | ||
new link |
new link |
||
); |
); |
||
⚫ | |||
PROC insert before = (REF LINK #self,# next, DATA new data)LINK: |
|||
insert after(#self,# prev OF next, new data); |
|||
⚫ | |||
# Test case: # |
# Test case: # |