LinkedList

public struct LinkedList<T> : CustomStringConvertible

A LinkedList utility implementation for tracking item nodes.

  • The default init.

    Declaration

    Swift

    public init()
  • Declaration

    Swift

    public var isEmpty: Bool { get }

    Return Value

    A Bool indicating if the LinkedList is empty.

  • Property for the first item in the LinkedList.

    Declaration

    Swift

    public var first: Node<T>? { get }
  • Adds a new element of type to the end of this LinkedList.

    Declaration

    Swift

    public mutating func append(_ value: T)

    Parameters

    value

    The object of type T to append to the LinkedList.

  • Removes a Node from this LinkedList.

    Declaration

    Swift

    public mutating func remove(_ node: Node<T>) -> T

    Parameters

    node

    The Node object to remove.

    Return Value

    The Node value of the Node that was removed from the LinkedList.

  • Property describing the LinkedList.

    Declaration

    Swift

    public var description: String { get }