Doubly-linked list/Element definition: Difference between revisions

m
m (Add lang example)
m (→‎{{header|Wren}}: Minor tidy)
 
(2 intermediate revisions by 2 users not shown)
Line 131:
Return</syntaxhighlight>
 
=={{header|BBC BASIC}}==
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
<syntaxhighlight lang="bbcbasic"> DIM node{pPrev%, pNext%, iData%}
Line 1,057 ⟶ 1,058:
{{libheader|Wren-llist}}
The DNode class in the above module is the element type for the DLinkedList class which is a generic doubly-linked list. The latter is implemented in such a way that the user does not need to deal directly with DNode though for the purposes of the task we show below how instances of it can be created and manipulated.
<syntaxhighlight lang="ecmascriptwren">import "./llist" for DNode
 
var dn1 = DNode.new(1)
Line 1,073 ⟶ 1,074:
[node 2, data = 2, prev = 1, next = null]
</pre>
 
=={{header|XPL0}}==
<syntaxhighlight lang "XPL0">
def \Node\ Prev, Data, Next; \Element (Node) definition
</syntaxhighlight>
 
=={{header|zkl}}==
9,476

edits