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,
appendandprependsimply call this function).Declaration
Swift
public mutating func insert(newElement:NodeType, atIndex index:Index) -
Undocumented
-
Removes the element
npositions from the beginning of the list and returns it.indexmust be a valid index or a precondition assertion will fail.Declaration
Swift
public mutating func removeAtIndex(index:Index) -> NodeTypeParameters
indexThe index of the element to remove.
Return Value
The removed element.
-
Undocumented
-
Undocumented
-
Removes all of the elements from the list. The
keepCapacityparameter is ignored.Declaration
Swift
public mutating func removeAll(#keepCapacity:Bool)
-
Undocumented
-
Undocumented
-
Undocumented
View on GitHub
LinkedList Extension Reference