Problems / Trees / Subtree of Another Tree
#51 Easy Time O(m·n) Space O(m) Animated

Subtree of Another Tree

Check if one tree is a subtree of another.

LeetCode ↗
Approach: DFS (Recursion)
Click play to start
Step 0 / 0
Press play to start the visualization.

Steps