Subtree of Another Tree
Given two binary trees root
and subRoot
, determine if subRoot
is a subtree of root
. A subtree of a binary tree is a tree that consists of a node in the tree and all of its descendants.
Input:
Output: true
You are on levelĀ Student
Given two binary trees root
and subRoot
, determine if subRoot
is a subtree of root
. A subtree of a binary tree is a tree that consists of a node in the tree and all of its descendants.
Input:
Output: true
Monster Assistant is thinking...