LinkedList::move

(Available since version 1.0)

LinkedList::moveMove an item from one index to another

Description

public void LinkedList::move ( int $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.

Parameters

offset_from

The index of the item to be moved.

offset_to

The index the item will be moved to.

Return Values

No value is returned.

Errors/Exceptions

Throws SEIDS::LinkedLists::OutOfRangeException when index is out of bounds or when index cannot be parsed as an integer.

To Top