01 — Problem Directory

Data Structures & Algorithms

Complete catalog of 99 interactive algorithm visualizers. Browse by data structure category or filter by difficulty.

Showing 23 of 99 visualizers
TR
Trees & BST
Easy
Balanced Binary Tree

Determine if a binary tree is height-balanced (depth of the two subtrees of every node never differs by more than 1).

DFSBinary TreeRecursion+2
TR
Trees & BST
Medium
Binary Tree Level Order Traversal

Traverse binary tree nodes level-by-level from left to right using a FIFO queue (BFS).

BFSBinary TreeQueue+1
TR
Trees & BST
Hard
Binary Tree Maximum Path Sum

Find the maximum path sum along any sequence of nodes in a binary tree using bottom-up postorder DFS (ignoring negative subtrees).

DFSBinary TreeRecursion+3
TR
Trees & BST
Medium
Binary Tree Right Side View

Return the values of the nodes you can see ordered from top to bottom when standing on the right side of the binary tree.

BFSBinary TreeQueue+2
TR
Trees & BST
Medium
Binary Tree Zigzag Level Order Traversal

Traverse binary tree levels alternating directions (left-to-right on even levels, right-to-left on odd levels).

BFSBinary TreeQueue+2
TR
Trees & BST
Medium
Count Complete Tree Nodes

Count nodes in a complete binary tree in less than O(n) time by comparing left and right subtree heights.

DFSBinary TreeBinary Search+2
TR
Trees & BST
Medium
Count Good Nodes in Binary Tree

Count the number of 'good' nodes in a binary tree (a node X is good if on the path from root to X there are no nodes with value greater than X).

DFSBinary TreeRecursion+2
TR
Trees & BST
Easy
Diameter of Binary Tree

Compute the diameter (longest path between any two nodes) by finding max(leftDepth + rightDepth) at each node using postorder DFS.

DFSBinary TreeRecursion+2
TR
Trees & BST
Easy
Binary Tree Inorder Traversal

Visit binary tree nodes in Left -> Root -> Right order producing sorted order for Binary Search Trees.

DFSBinary TreeInorder+1
TR
Trees & BST
Easy
Invert Binary Tree

Invert a binary tree by recursively swapping the left and right child subtrees of every node.

DFSBinary TreeRecursion+1
TR
Trees & BST
Medium
Kth Smallest Element in a BST

Find the kth smallest element (1-indexed) in a Binary Search Tree (BST) using in-order DFS traversal step counting.

BSTBinary Search TreeDFS+2
TR
Trees & BST
Medium
Lowest Common Ancestor of a Binary Search Tree

Find the lowest common ancestor (LCA) node of two given nodes p and q in a Binary Search Tree (BST) using value comparisons.

BSTBinary Search TreeDFS+2
TR
Trees & BST
Easy
Maximum Depth of Binary Tree

Find the maximum depth (height) of a binary tree by calculating 1 + max(leftDepth, rightDepth) recursively.

DFSBinary TreeRecursion+1
TR
Trees & BST
Medium
Maximum Width of Binary Tree

Calculate the maximum width among all levels of a binary tree by assigning 0-indexed position coordinates and normalizing each level against its starting index.

BFSBinary TreeQueue+2
TR
Trees & BST
Easy
Path Sum

Determine if the binary tree has a root-to-leaf path such that adding up all values along the path equals targetSum.

DFSBinary TreeRecursion+2
TR
Trees & BST
Medium
Path Sum II

Find all unique root-to-leaf paths where the sum of the node values equals targetSum using DFS backtracking.

DFSBinary TreeRecursion+2
TR
Trees & BST
Easy
Binary Tree Postorder Traversal

Visit binary tree nodes in Left -> Right -> Root order for bottom-up calculation and subtree evaluation.

DFSBinary TreePostorder+1
TR
Trees & BST
Easy
Binary Tree Preorder Traversal

Visit binary tree nodes in Root -> Left -> Right order using DFS recursion and call stack unwinding.

DFSBinary TreeRecursion+1
TR
Trees & BST
Easy
Same Tree

Check if two binary trees are structurally identical and have the same node values using simultaneous DFS recursion.

DFSBinary TreeRecursion+1
TR
Trees & BST
Easy
Subtree of Another Tree

Check if binary tree subRoot is a subtree of root with identical structure and node values.

DFSBinary TreeRecursion+2
TR
Trees & BST
Medium
Sum Root to Leaf Numbers

Calculate the total sum of all numbers formed along root-to-leaf paths (each path represents a decimal number).

DFSBinary TreeRecursion+1
TR
Trees & BST
Easy
Symmetric Tree

Check whether a binary tree is a mirror of itself (symmetric around its center) using simultaneous dual-pointer DFS recursion.

DFSBinary TreeRecursion+2
TR
Trees & BST
Medium
Validate Binary Search Tree

Determine if a binary tree is a valid Binary Search Tree (BST) where every node satisfies min < node.val < max recursively.

BSTBinary Search TreeDFS+2