Singly-linked list/Element definition: Difference between revisions
Content deleted Content added
m Changed over to headers. |
m Spelling/grammar/aesthetics |
||
Line 1:
{{task}}[[Category:Data Structures]]Define the data structure for a [[singly-linked list]] element.
▲Define the data structure for a [[singly-linked list]] element. Said element should contain a data member capable of holding a numeric value, and the link to the next element should be mutable.
=={{header|Ada}}==
Line 60 ⟶ 58:
=={{header|Delphi}}==
A simple one way list.
Type
Line 109 ⟶ 107:
=={{header|Haskell}}==
This task is not idiomatic for Haskell. Usually, all data in pure functional programming is immutable, and deconstructed through [[Pattern Matching]]. The Prelude already contains a parametrically polymorphic list type that can take any data member type, including numeric values. These lists are then used very frequently. Because of this, lists have additional special syntactic sugar.▼
▲in pure functional programming is immutable, and deconstructed through [[Pattern Matching]]. The Prelude already contains a parametrically polymorphic list type that can take any data member type, including numeric values. These lists are then used very frequently. Because of this, lists have additional special syntactic sugar.
An equivalent declaration for such a list type without the special syntax would look like this:
Line 152 ⟶ 149:
l2 =>
If however one wants to
uses objectclass;
|