All content related to queue

Implement Stack using Queues

Write a program to implement a stack using the queues. The implemented stack should support standard operations like push(x), pop(), and top(). This is an excellent problem to learn problem-solving and visualize the use case of stack and queue operations.

EnjoyAlgorithms

Implement Queue using Stacks

Write a program to Implement a queue using the stack. The implemented queue should support standard operations like enqueue, dequeue, and front. This is an excellent problem to learn problem-solving and visualize the use case of stack and queue operations.

EnjoyAlgorithms

Level Order Traversal of a Binary Tree :  Breadth First Search

Level order traversal accesses nodes in level by level order. This is also called breadth-first search traversal or BFS traversal. Here we start from the root node and process it, then process all the nodes at the first level, then process all the nodes at the second level, and so on. In other words, we explore all nodes at the current level before moving on to the nodes at the next level.

EnjoyAlgorithms

Our Weekly Newsletter

Subscribe to get free weekly content on data structure and algorithms, machine learning, system design, oops and math.