Singly-linked list/Traversal: Difference between revisions
Content deleted Content added
Better first D entry |
No edit summary |
||
Line 1:
{{task|Data Structures}}[[Category:Iteration]]
Traverse from the beginning of a singly-linked list to the end.
=={{header|ACL2}}==
The standard list data type is a singly linked list.
<lang Lisp>(defun traverse (xs)
(if (endp xs)
(cw "End.~%")
(prog2$ (cw "~x0~%" (first xs))
(traverse (rest xs)))))</lang>
=={{header|ActionScript}}==
|