Doubly-linked list/Element definition: Difference between revisions

m
→‎{{header|REXX}}: changed boxed comments.
m (→‎{{header|REXX}}: moved comment box outside of program, elided OVERFLOW from the html PRE tag.)
m (→‎{{header|REXX}}: changed boxed comments.)
Line 654:
=={{header|REXX}}==
REXX doesn't have linked lists, as there are no pointers (or handles).
<br>However, linked lists can be simulated with lists in REXX.
<br>
 
However, linked lists can be simulated with lists in REXX.
╔═════════════════════════════════════════════════════════════════════════╗
┌────────────────────────────────────────────────────────────────────┐
┌─┘ ☼☼☼☼☼☼☼☼☼☼☼ Functions of the List Manager ☼☼☼☼☼☼☼☼☼☼☼ └─┐
@init ─── initializes the List.
@init ─── initializes the List.
@size ─── returns the size of the List [could be a 0 (zero)].
└─┐ ┌─┘
│ @size ─── returns the size of the List [could be 0 (zero)]. │
@show ─── shows (displays) the complete List.
@show ║ @show k,1 ─── shows (displays) the complete ListKth item.
@get ║ @show k,m ─── returnsshows the(displays) M items, starting with the Kth item.
│ @show k,1 ─── shows (displays) the Kth item. │
@show k,m ,─1 ─── shows (displays) the complete MList backwards. items, starting with Kth item.
║ ║
│ @show ,,─1 ─── shows (displays) the complete List backwards. │
@get k ─── returns the Kth item.
│ @get k ─── returns the Kth item. @get k,m ─── returns the M items starting with the Kth item.
║ ║
│ @get k,m ─── returns the M items starting with the Kth item. │
@put x ─── adds the X items to the end (tail) of the List.
@put x ,0 ─── adds the X items to the end start (tailhead) of the List.
@put x,0k ─── adds the X items to the start (head)before of the List Kth item.
║ ║
│ @put x,k ─── adds the X items to before of the Kth item. │
@del k ─── deletes the item K.
@del k ─── deletes the item K. @del k,m ─── deletes the M items starting with item K.
╚═════════════════════════════════════════════════════════════════════════╝
│ @del k,m ─── deletes the M items starting with item K. │
└─┐ ┌─┘
└────────────────────────────────────────────────────────────────────┘
<lang rexx>/*REXX program that implements various List Manager functions. */
call sy 'initializing the list.' ; call @init