O(n) · visualised
Algorithm & data-structure visualizer
Watch classic algorithms and data structures run step by step. Pick one to start.
Visualizations
BFSBreadth-first search explores a graph level by level using a FIFO queue.Stack (LIFO)A stack is a last-in, first-out (LIFO) structure: push adds to the top, pop removes the top.Queue (FIFO)A queue is a first-in, first-out (FIFO) structure: enqueue adds to the back, dequeue removes from the front.DequeA deque (double-ended queue) allows adding and removing from both ends.