Chapter 8: Queues
前言
大綱
Common operations
public protocol Queue {
associatedtype Element
mutating func enqueue(_ element: Element) -> Bool
mutating func dequeue() -> Element?
var isEmpty: Bool { get }
var peek: Element? { get }
}Array-based implementation

Doubly linked list implementation

Ring buffer implementation

Double-stack implementation



Last updated