Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
But the fo...
分类:
其他好文 时间:
2015-03-28 11:34:30
阅读次数:
102
/* 给一颗二叉树,问是否关于中心对称*//** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNod...
分类:
其他好文 时间:
2015-03-19 23:46:10
阅读次数:
152
题目:判断一个矩阵是不是中心对称。
分析:简单题。直接判断即可。
说明:注意不能有负数╮(╯▽╰)╭。
#include
#include
#include
#include
#include
#include
using namespace std;
long long M[101][101];
int main()
{
int T,N;
char ch;
whi...
分类:
其他好文 时间:
2015-03-18 14:08:00
阅读次数:
100
题目:Symmetric Tree /**LeetCode Symmetric Tree 对称的树
* 思路:判断一棵树是否对称,1.有左子树就要有右子树
* 2.除根节点外对称节点值要相同
* 注意:对称后就是左子树的左节点和右子树的右节点比较
* Definition for binary tree
* public class TreeNode {
*...
分类:
其他好文 时间:
2015-03-17 20:13:33
阅读次数:
149
多核CPU运行模式主要有以下三种: ?非对称多处理(Asymmetric multiprocessing,AMP)——每个CPU内核运行一个独立的操作系统或同一操作系统的独立实例(instantiation)。 ?对称多处理(Symmetric multiprocessing,SMP)——一个操.....
分类:
其他好文 时间:
2015-03-14 10:50:28
阅读次数:
153
题目:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
But the fo...
分类:
其他好文 时间:
2015-03-11 17:19:41
阅读次数:
143
Symmetric Tree问题:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).思路: dfs我的代码:public class Solution { ...
分类:
其他好文 时间:
2015-03-07 19:58:45
阅读次数:
135
最近要在MIC机群上做分布式开发,发现有两种模式可以用:
1) offload模式:该模式和GPGPU编程思想类似,把并行度高的代码转移到local的MIC处理器上执行,其它代码仍然在CPU上执行。MIC只负责本地计算,分布式通信必须在CPU上执行。
2)symmetric模式:编译出在MIC和CPU上执行的两份二进制代码。该模式逻辑上允许MIC进行分布式通信,虽然物理上消息还是从CPU走的。...
分类:
其他好文 时间:
2015-03-07 06:19:14
阅读次数:
182
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 exam...
分类:
其他好文 时间:
2015-03-02 20:45:29
阅读次数:
203
题目1.same treeGiven 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.2.sym...
分类:
其他好文 时间:
2015-03-02 16:51:53
阅读次数:
135