Anonymous user
Doubly-linked list/Traversal: Difference between revisions
m
→{{header|REXX}}: consolidated annotation with the "calling" statements. -- ~~~~
m (→{{header|REXX}}: added whitespace, added DO-END comment label, indented DO loop. -- ~~~~) |
m (→{{header|REXX}}: consolidated annotation with the "calling" statements. -- ~~~~) |
||
Line 870:
└─┐ ┌─┘
└────────────────────────────────────────────────────────────────────┘*/
call sy 'initializing the list.'
call sy 'building list: Was it a cat I saw'; call @put 'Was it a cat I saw'
call sy 'displaying list size.' ;
call sy 'backward list'
call sy 'showing 4th item' ; call @show 4,1
call sy 'showing 6th & 6th items'
call sy 'showing list'
call sy 'adding to tail: there, in the ...'; call @put 'there, in the shadows, stalking its prey (and next meal).'▼
call sy 'showing list'
call sy 'adding to head: Oy!' ; call @put 'Oy!',0
call sy 'showing list'
▲ call sy 'adding item before item 4: black'
▲ call sy 'showing list'
▲call @put 'there, in the shadows, stalking its prey (and next meal).'
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────subroutines─────────────────────────*/
|