ContiguousDeque

A Deque is a data structure comprised of two queues. This implementation has a front queue, which is a reversed ContiguousArray, and a back queue, which is a ContiguousArray. Operations at either end of the Deque have the same complexity as operations on the end of either ContiguousArray.

  • The front and back queues. The front queue is stored in reverse

    Declaration

    Swift

    public var front, back: ContiguousArray<Element>
  • Initialise an empty ContiguousDeque

    Declaration

    Swift

    public init() { (front, back) = ([], []) }