Doubly-linked list/Element definition: Difference between revisions

PascalABC.NET
(Added XPL0 example.)
(PascalABC.NET)
 
(One intermediate revision by one other user not shown)
Line 681:
data: data_ptr;
end;</syntaxhighlight>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
type Node<T> = auto class
data: T;
prev,next: Node<T>;
end;
</syntaxhighlight>
 
=={{header|Perl}}==
Line 1,058 ⟶ 1,066:
{{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)
234

edits