Stack & Queue 4: Stack using two queues | Must Do Coding Questions | GeeksForGeeks

Publié le: 06 août 2021
sur la chaîne: Krishna Teaches
692
14

This video contains Must Do Coding Questions for Companies like Amazon, Microsoft, Adobe, …
from geeksforgeeks platform.

website link:
https://www.geeksforgeeks.org/must-do...

Topics covered in this video series are:
1.Arrays
   • 1.1 ARRAYS | Must Do Coding Questions  
2.String
   • 1.2 STRING | Must Do Coding Questions  
3.Linked List
   • 1.3 LINKED LIST | Must Do Coding Questions  
4.Stack and Queue
5.Tree and BST
6.Heap
7.Recursion
8.Hashing
9.Graph
10.Greedy
11.Dynamic Programming
12.Divide and Conquer
13.Backtracking
14.Bit Magic

Stack and Queue:
4: Stack using two Queues:
Implement a Stack using two queues q1 and q2.

Example 1:
Input:
push(2)
push(3)
pop()
push(4)
pop()
Output: 3 4
Explanation:
push(2) the stack will be {2}
push(3) the stack will be {2 3}
pop() poped element will be 3 the
stack will be {2}
push(4) the stack will be {2 4}
pop() poped element will be 4

Example 2:
Input:
push(2)
pop()
pop()
push(3)
Output: 2 -1

Code Link:
https://github.com/krishna-gavas/Comp...

Intro Music :
   • Video  p


Sur cette page du site, vous pouvez voir la vidéo en ligne Stack & Queue 4: Stack using two queues | Must Do Coding Questions | GeeksForGeeks durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Krishna Teaches 06 août 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 692 fois et il a aimé 14 téléspectateurs. Bon visionnage!