DequeType
A Deque is a data structure comprised of two queues. This implementation has a front queue, which is reversed, and a back queue, which is not. Operations at either end of the Deque have the same complexity as operations on the end of either queue.
Three structs conform to the DequeType protocol: Deque, DequeSlice, and
ContiguousDeque. These correspond to the standard library array types.
-
A textual representation of
self, suitable for debugging.Declaration
Swift
public var debugDescription: String
-
Construct from a collection
Declaration
Swift
public init< C : CollectionType where C.Index : RandomAccessIndexType, C.SubSequence.Generator.Element == Container.Generator.Element, C.Index.Distance == Container.Index.Distance >(col: C)
-
Reserve enough space to store
minimumCapacityelements.- Postcondition:
capacity >= minimumCapacityand theDequehas mutable contiguous storage. - Complexity: O(
count).
Declaration
Swift
public mutating func reserveCapacity(n: Container.Index.Distance) - Postcondition:
-
Return a
Dequecontaining the elements ofselfin reverse order.Declaration
Swift
public func reverse() -> Self
-
Return a value less than or equal to the number of elements in
self, nondestructively.Declaration
Swift
public func underestimateCount() -> Int
View on GitHub
DequeType Extension Reference