isIdentical
that takes two nodes from two trees and recursively checks if they are identical.isSubtree
that uses DFS to traverse the root
tree.root
tree, use isIdentical
to check if the subtree rooted at that node is identical to subRoot
.isIdentical
returns true
for any node, return true
for the isSubtree
function.false
.