Search⌘ K
AI Features

Same Tree

Same Tree gives you the roots of two binary trees. Return whether they are identical in both structure and node values, including matching empty branches.

Statement

Given the roots of two binary trees, p and q, write a function to check whether or not they are the same. Two binary trees are ...