Jump to content

Doubly-linked list/Element insertion: Difference between revisions

m
Line 66:
);
 
# BEGIN rosettacode task code specimen code:
can alsohandle insert both before the first, and after the last link #
 
PROC insert after = (REF LINK #self,# prev, DATA new data)LINK: (
# DOWN do link OF splice OF self; to make thread safe #
Line 76 ⟶ 77:
new link
);
 
# END rosettacode task code specimen #
PROC insert before = (REF LINK #self,# next, DATA new data)LINK:
insert after(#self,# prev OF next, new data);
 
# END rosettacode task code specimen code #
 
# Test case: #
Cookies help us deliver our services. By using our services, you agree to our use of cookies.