Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 494 Bytes

readme.md

File metadata and controls

15 lines (12 loc) · 494 Bytes

Same Tree Solution

  1. Approach
  • Recursively compare nodes of both trees
  • Base case: if both nodes are None, return True
  • If one node is None and the other is not, return False
  • If values of nodes are different, return False
  • Recursively check left and right subtrees
  • Time: O(n) where n is the number of nodes in the tree
  • Concepts: Recursion, Binary Trees

Link to problem Leetcode Problem Number #100 STATUS : Accepted