algo/swift/08_stack/Stack.swift
2018-10-13 15:37:24 +08:00

22 lines
471 B
Swift

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