Search⌘ K
AI Features

Subtree of Another Tree

Subtree of Another Tree compares two binary trees and asks whether the second appears in the first with identical values, structure, and all descendants, returning true or false.

Statement

Given the roots of two binary trees, root and sub_root, return TRUE if there is a subtree ...