RosettaCodeData/Task/Singly-linked-list-Element-insertion/OoRexx/singly-linked-list-element-insertion.rexx
2017-09-25 22:28:19 +02:00

6 lines
305 B
Rexx

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"