SwiftDataStructures Docs (35% documented)

SwiftDataStructures Reference LinkedList Struct Reference

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

  • Returns the element at the specified index, or nil if the index was out of range.

    Declaration

    Swift

    public func at(index:Index) -> Generator.Element?
  • Returns the index of the first element for which predicate returns true.

    Declaration

    Swift

    public func find(predicate: (LinkedListNode<T>) -> Bool) -> Index?
  • Inserts the provided element at the beginning of the list.

    Declaration

    Swift

    public mutating func prepend(newElement:NodeType)
  • Removes the last element from the list and returns it. The list must contain at least 1 element or a precondition will fail.

    Declaration

    Swift

    public mutating func removeLast() -> NodeType