algo/swift/09_queue/Queue.swift
2018-10-11 22:56:35 +08:00

22 lines
478 B
Swift

//
// Created by Jiandan on 2018/10/11.
// Copyright (c) 2018 Jiandan. All rights reserved.
//
import Foundation
protocol Queue {
///
associatedtype Element
///
var isEmpty: Bool { get }
///
var size: Int { get }
///
var peek: Element? { get }
///
mutating func enqueue(newElement: Element) -> Bool
///
mutating func dequeue() -> Element?
}