Queue

BFS Shortest Path in an Unweighted Graph

Find the minimum number of edges (and optionally the actual route) between two vertices in an unweighted graph using BFS.

BFS Shortest Path in an Unweighted Graph (Authoritative) — Open the Lock

Use BFS to find the minimum number of moves in an implicit unweighted graph (LeetCode 752: Open the Lock).

BFS Shortest Path in Unweighted Graph (O(V+E))

Learn BFS shortest path in an unweighted graph: O(V+E) time, queue + parent[] for path reconstruction. Step-by-step for interviews—start now.

Breadth First Search (Shortest Reach)

Compute shortest distances from a start node in an undirected graph with uniform edge weight using BFS.

Breadth-First Search (BFS) Algorithm: Queue + O(V+E)

Learn BFS traversal with a FIFO queue + visited set. Includes BFS pseudocode, example, and O(V+E) complexity—practice for FAANG interviews.

Design Circular Queue

Design a circular queue with fixed size that supports enqueue, dequeue, front, rear, isEmpty, and isFull operations.

Implement Queue

Implement a queue using arrays or linked lists with O(1) time complexity for all operations.

Implement Queue using Stacks

Implement a queue using two stacks with O(1) amortized time complexity for all operations.

Implement Stack using Queues

Implement a stack using two queues with O(1) amortized time complexity for all operations.

Level Order Traversal

Traverse a binary tree level by level from left to right.

Rotten Oranges Problem

Find the minimum time for all oranges to rot using BFS