Singly-linked list/Element definition: Difference between revisions
Content added Content deleted
imported>Chinhouse |
m (→{{header|Wren}}: Minor tidy) |
||
Line 2,018: | Line 2,018: | ||
{{libheader|Wren-llist}} |
{{libheader|Wren-llist}} |
||
The Node class in the above module is the element type for the LinkedList class which is a generic singly-linked list. The latter is implemented in such a way that the user does not need to deal directly with Node though for the purposes of the task we show below how instances of it can be created and manipulated. |
The Node class in the above module is the element type for the LinkedList class which is a generic singly-linked list. The latter is implemented in such a way that the user does not need to deal directly with Node though for the purposes of the task we show below how instances of it can be created and manipulated. |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wren">import "./llist" for Node |
||
var n1 = Node.new(1) |
var n1 = Node.new(1) |