Skip to main content

9 docs tagged with "Depth-First Search"

View all tags

Balanced Binary Tree

Determine if a given binary tree is height-balanced, meaning the heights of the two subtrees of every node never differ by more than one.

Combination Sum

Find all unique combinations of distinct integers that sum up to a target value.

Flood Fill

Given a 2D grid representing an image, a starting pixel's coordinates, and a new color, change the color of the starting pixel and all…

Invert Binary Tree

Given the root of a binary tree, invert the tree by swapping its left and right children at each node.