filmov
tv
LeetCode Question #572: Subtree of Another Tree
Показать описание
Jason Wang (IU '21) and Jarod Saxberg (IU '21) walk through an algorithm to determine whether one tree is the subtree of another.
Time Complexity : O(m * n), where m and n represent the number of nodes in each tree.
Space Complexity : O(n), where n is the number of nodes in the proposed subtree.
Chapters:
Intro - 0:00
Problem Overview - 0:38
Difference Between Binary Trees & Binary Search Trees - 1:44
Initial Solution - 3:05
Submission & Discussion - 19:10
Alternative Solution - 22:40
Time Complexity : O(m * n), where m and n represent the number of nodes in each tree.
Space Complexity : O(n), where n is the number of nodes in the proposed subtree.
Chapters:
Intro - 0:00
Problem Overview - 0:38
Difference Between Binary Trees & Binary Search Trees - 1:44
Initial Solution - 3:05
Submission & Discussion - 19:10
Alternative Solution - 22:40