Skip to content

Commit 2eb9ea4

Browse files
added time complexity for this code
1 parent c9e871c commit 2eb9ea4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Queues/Implementation/usingStack.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ int i=0;
1414
// 1. Push everything from stack1 to stack2
1515
// 2. insert x or num to stack 1
1616
// 3. Again push every number from stack2 to stack1
17+
// 4. TC: O(N) SC: O(2N)
1718
int x;
1819
cin>>x;
1920
while(!st1.empty()){

0 commit comments

Comments
 (0)