原文:[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 identical and the nodes have the same value. Example : ...

2014-10-27 07:54 5 10709 推荐指数:

查看详情

[leetcode]Same Tree @ Python

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

Fri May 23 18:51:00 CST 2014 0 3413
[LeetCode] Symmetric Tree 判断对称

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric ...

Sun Oct 26 18:49:00 CST 2014 17 12959
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM