Singly-linked list/Reversal: Difference between revisions

→‎{{header|ALGOL 68}}: And another type...
(→‎{{header|ALGOL 68}}: Another typo :()
(→‎{{header|ALGOL 68}}: And another type...)
Line 9:
Using the code from the [[Singly-linked list/Traversal#ALGOL_68]] Task
<br>LOC and HEAP are like NEW in other languages. LOC generates a new item on the stack and HEAP a new item on the heap (which is garbage collected).
<br>The use of LOC in the outermost level ifis OK as the generated elements will exist until the final END, but HEAP must be used in the loop creating the reverse list elements, to ensure they still exist when the loop exits.
<syntaxhighlight lang="algol68">
BEGIN
3,045

edits