Stack

public struct Stack<T>

Last-in first-out stack (LIFO) Push and pop are O(1) operations.

  • Undocumented

    Declaration

    Swift

    public var isEmpty: Bool { get }
  • Undocumented

    Declaration

    Swift

    public var count: Int { get }
  • Undocumented

    Declaration

    Swift

    public mutating func push(_ element: T)
  • Undocumented

    Declaration

    Swift

    public mutating func pop() -> T?
  • Undocumented

    Declaration

    Swift

    public mutating func pushUnderTop(_ element: T)
  • Undocumented

    Declaration

    Swift

    public mutating func popUnderTop() -> T?
  • top

    Undocumented

    Declaration

    Swift

    public var top: T? { get }
  • Declaration

    Swift

    public func makeIterator() -> AnyIterator<T>