Doubly-linked list/Element definition: Difference between revisions
Content added Content deleted
(→E: crosslink, lang tag) |
|||
Line 96:
=={{header|E}}==
This does no type-checking, under the assumption that it is being used by a containing doubly-linked list object which enforces that invariant along with others such as that <code>element.getNext().getPrev() == element</code>. See [[Doubly-Linked List#E]] for an actual implementation (which uses slightly more elaborate nodes than this).
def element {
to setValue(v) { value := v }
to getValue() { return value }
to setNext(n) { next := n }
to getNext() { return next }
to setPrev(p) { prev := p }
to getPrev() { return prev }
Line 111:
return element
}</lang>
=={{header|Fortran}}==
|