Anonymous user
Singly-linked list/Element insertion: Difference between revisions
Singly-linked list/Element insertion (view source)
Revision as of 22:10, 12 June 2012
, 12 years ago→{{header|ooRexx}}: Better version of this and a reference to full class definition.
(→{{header|ooRexx}}: Add example for ooRexx) |
(→{{header|ooRexx}}: Better version of this and a reference to full class definition.) |
||
Line 677:
=={{header|ooRexx}}==
See [[Singly-linked_list/Element_definition#ooRexx|Single-linked list/Element definition]] for full class definition.
<lang ooRexx>
list = .linkedlist~new
index = list~insert("abc") -- insert a first item, keeping the index
list~insert("def") -- adds to the end
list~insert("123", .nil) -- adds to the begining
list~insert("456", index) -- inserts between "abc" and "def"
list~remove(index) -- removes "abc"
</lang>
=={{header|Pascal}}==
Note: This code uses only Standard Pascal features. For code using features only available in modern Pascal versions, see above under "[Delphi / Object Pascal / >>Turbo Pascal<<]"
|