Doubly-linked list/Element insertion: Difference between revisions

(Added C++ solution)
Line 523:
r.next = n
if r == l.tail: l.tail = n</lang>
 
=={{header|Objeck}}==
<lang objeck>method : public : native : AddBack(value : Base) ~ Nil {
node := ListNode->New(value);
if(@head = Nil) {
@head := node;
@tail := @head;
@cursor := @head;
}
else {
@tail->SetNext(node);
node->SetPrevious(@tail);
@tail := node;
};
@size += 1;
}</lang>
 
=={{header|OCaml}}==
760

edits