Skip to content

Commit 7ec8c91

Browse files
committed
leetcode
1 parent f3002c6 commit 7ec8c91

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: ImplementQueueUsingStacks/implement_queue_using_stacks.dart

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// You must use only standard operations of a stack, which means only push to top, peek/pop from top, size, and is empty operations are valid.
1616
// Depending on your language, the stack may not be supported natively. You may simulate a stack using a list or deque (double-ended queue) as long as you use only a stack's standard operations.
1717

18-
1918
// Example 1:
2019

2120
// Input
@@ -32,14 +31,12 @@
3231
// myQueue.pop(); // return 1, queue is [2]
3332
// myQueue.empty(); // return false
3433

35-
3634
// Constraints:
3735

3836
// 1 <= x <= 9
3937
// At most 100 calls will be made to push, pop, peek, and empty.
4038
// All the calls to pop and peek are valid.
4139

42-
4340
// Follow-up: Can you implement the queue such that each operation is amortized O(1) time complexity? In other words, performing n operations will take overall O(n) time even if one of those operations may take longer.
4441

4542
// */
@@ -78,7 +75,6 @@
7875

7976
// /*
8077

81-
8278
// class MyQueue {
8379

8480
// MyQueue() {
@@ -102,7 +98,6 @@
10298
// }
10399
// }
104100

105-
106101
// */
107102

108103
// abstract class Stack<T> {
@@ -196,3 +191,5 @@
196191
// }
197192

198193
// enum _Phase { push, pop }
194+
195+

0 commit comments

Comments
 (0)