(Available since version 1.0)
LinkedList::move — Move an item from one index to another
$offset_from
,
int
$offset_to
)
Moves the item at offset_from
to
offset_to
shuffling indexes as
necessary.
Note:
This is a slow method (Θ(n) amortized time) due to the seek operations involved. As this is a singly linked list it is slower to move an item down the list than it is to move an item up.
offset_from
The index of the item to be moved.
offset_to
The index the item will be moved to.
No value is returned.
Throws SEIDS::LinkedLists::OutOfRangeException when
index
is out of bounds or when index
cannot be parsed as an integer.