原文:【LeetCode】100. Same Tree (2 solutions)

Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 解法一:递归 ...

2014-12-01 22:57 0 4435 推荐指数:

查看详情

[LeetCode] 100. Same Tree 判断相同树

Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ...

Mon Oct 27 15:54:00 CST 2014 5 10709
[leetcode]Same Tree @ Python

原题地址:https://oj.leetcode.com/problems/same-tree/ 题意:判断两棵树是否是同一棵树。 解题思路:这题比较简单。用递归来做。首先判断两个根节点的值是否相同,如果相同,递归判断根的左右子树。 代码: ...

Fri May 23 18:51:00 CST 2014 0 3413
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM