原文:[leetcode]Symmetric Tree @ Python

原题地址:https: oj.leetcode.com problems 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 symme ...

2014-05-23 11:03 0 4264 推荐指数:

查看详情

[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 ...

Fri Nov 16 04:54:00 CST 2012 0 3356
Symmetric Tree leetcode java

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

Thu Jul 31 08:05:00 CST 2014 0 2981
leetcode: Symmetric Tree

判断一棵树是否对称,如果对称,中序遍历的结果一定也是对称的。 看了一下别人的代码,也可以在递归的过程中直接去判断。 ...

Sun Jul 28 01:58:00 CST 2013 2 2594
[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
[leetcode]Same Tree @ Python

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

Fri May 23 18:51:00 CST 2014 0 3413
[leetcode]Balanced Binary Tree @ Python

原题地址:http://oj.leetcode.com/problems/balanced-binary-tree/ 题意:判断一颗二叉树是否是平衡二叉树。 解题思路:在这道题里,平衡二叉树的定义是二叉树的任意节点的两颗子树之间的高度差小于等于1。这实际上是AVL树的定义。首先要写一个计算 ...

Sat May 10 18:54:00 CST 2014 0 5388
[leetcode]Binary Tree Level Order Traversal @ Python

原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/ 题意:二叉树的层序遍历的实现。 解题思路:二叉树的层序遍历可以用bfs或者dfs来实现。这里使用的dfs实现,代码比较简洁。实际上,二叉树的先序遍历 ...

Mon May 12 01:55:00 CST 2014 0 4584
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM