Singly-linked list/Element definition: Difference between revisions
Content added Content deleted
(Created task) |
|||
Line 2: | Line 2: | ||
Define the data structure for a [[singly-linked list]] element. Said an element should contain a data member capable of holding a numeric value. |
Define the data structure for a [[singly-linked list]] element. Said an element should contain a data member capable of holding a numeric value. |
||
==[[Ada]]== |
|||
[[Category:Ada]] |
|||
type Link; |
|||
type Link_Access is access Link; |
|||
type Link is record |
|||
Next : Link_Access := null; |
|||
Data : Integer; |
|||
end record; |
|||
==[[C]]== |
==[[C]]== |
Revision as of 01:51, 20 March 2007
![Task](http://static.miraheze.org/rosettacodewiki/thumb/b/ba/Rcode-button-task-crushed.png/64px-Rcode-button-task-crushed.png)
You are encouraged to solve this task according to the task description, using any language you may know.
Define the data structure for a singly-linked list element. Said an element should contain a data member capable of holding a numeric value.
Ada
type Link; type Link_Access is access Link; type Link is record Next : Link_Access := null; Data : Integer; end record;
C
struct link { link *next; int data; }