Queue
public struct Queue<T>
extension Queue: CustomStringConvertible
A queue data structure implementation for managing FIFO (First In First Out) type of operations.
-
Declaration
Swift
public var isEmpty: Bool { get }Return Value
A
Boolindicating if the queue is empty. -
Adds a new element of type
to this Queueinstance.Declaration
Swift
public mutating func enqueue(_ element: T)Parameters
elementThe object to add to the queue.
-
Removes an element from the queue.
Declaration
Swift
public mutating func dequeue() -> T?Return Value
The queue element that was removed from the queue.
-
Declaration
Swift
public func peek() -> T?Return Value
The next queue element in the queue. Does not remove the element from the queue.
-
Declaration
Swift
public var description: String { get }Return Value
A
Stringdescribing the contents of the queue.
View on GitHub
Queue Structure Reference