Stack - (Using LinkedList)
123456789101112131415161718192021222324252627282930313233343536373839
class Node {
var value: Any
var next: Node?
init(_ value: Any) {
self.value = value
self.next = nil
}
}
class Stack {
var top: Any?
var bottom: Any?
var length: Int
init() {
self.top = nil
self.bottom = nil
self.length = 0
}
func peek() {
}
func push(_ value: Any) {
}
func pop() {
}
func isEmpty() -> Bool {
return true
}
}
Swift
INFO