LinkedList
LinkedList
is intended to be used in the implementation of other collection types. To this end, it intentionally exposes some of its own implementation details (particularly, the existence LinkedListNode<T>
) so that developers can make use of these details to optimize the types they build on top of it.
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Inserts the provided element at the specified index of the list. The index must be >= startIndex and <= endIndex. Insert can therefore be used to append and prepend elements to the list (and, in fact,
append
andprepend
simply call this function).Declaration
Swift
public mutating func insert(newElement:NodeType, atIndex index:Index)
-
Undocumented
-
Removes the element
n
positions from the beginning of the list and returns it.index
must be a valid index or a precondition assertion will fail.Declaration
Swift
public mutating func removeAtIndex(index:Index) -> NodeType
Parameters
index
The index of the element to remove.
Return Value
The removed element.
-
Undocumented
-
Undocumented
-
Removes all of the elements from the list. The
keepCapacity
parameter is ignored.Declaration
Swift
public mutating func removeAll(#keepCapacity:Bool)
-
Undocumented
-
Undocumented
-
Undocumented