Skip to content

Commit

Permalink
Update ImplementQueueUsingStacks.swift
Browse files Browse the repository at this point in the history
Add question link and complexity analysis
  • Loading branch information
ilyarmnzhdn authored Jul 10, 2019
1 parent 2566a6e commit 9d0f892
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Queue/ImplementQueueUsingStacks.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Question Link: https://leetcode.com/problems/implement-queue-using-stacks/
* Primary idea: queue
* Time Complexity: O(n), Space Complexity: O(n)
*
* Copyright © 2019 Ilyar Mnazhdin. All rights reserved.

* Your MyQueue object will be instantiated and called as such:
* let obj = MyQueue()
* obj.push(x)
* let ret_2: Int = obj.pop()
* let ret_3: Int = obj.peek()
* let ret_4: Bool = obj.empty()
*/

import Foundation

class MyQueue {
Expand Down Expand Up @@ -29,12 +44,3 @@ class MyQueue {
return storage.isEmpty
}
}

/**
* Your MyQueue object will be instantiated and called as such:
* let obj = MyQueue()
* obj.push(x)
* let ret_2: Int = obj.pop()
* let ret_3: Int = obj.peek()
* let ret_4: Bool = obj.empty()
*/

0 comments on commit 9d0f892

Please sign in to comment.