Recursive.class Solution { public: bool isSymmetric(TreeNode *pl, TreeNode *pr) { if (!pl && !pr) return true; if ((pl && !pr)...
分类:
其他好文 时间:
2014-07-22 00:36:36
阅读次数:
197
heap
-------------------------------------------------------------------------
binary heap 是一种完全二叉树。
隐式表示法:以 array 表述 tree。
小技巧:将 array 的 #0 元素保留,则第 i 个元素的左右子节点分别是 2i 和 2i + 1,
父节点是i/2 --> STL 里没有采用这种小技巧
将 array 无法动态改变大小,所以用 vector 替代 array
这个文件里提供了各种堆操作的...
分类:
其他好文 时间:
2014-07-22 00:32:34
阅读次数:
256
2014-07-2110:28:34首先PO上主要Python代码(2.7), 这个代码在Deep Learning上可以找到. 1 # allocate symbolic variables for the data 2 index = T.lscalar() # index to...
分类:
编程语言 时间:
2014-07-22 00:29:38
阅读次数:
352
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=32481391605812096The SetStack ComputerAcceptedC++0...
分类:
其他好文 时间:
2014-07-22 00:28:38
阅读次数:
220
贪心加树状数组
给出的数据可能出现两种情况,包含与不包含,但我们从右向左删就能避免这个问题;
#include
#include
#include
using namespace std;
const int maxn=200010;
int f[maxn],l[maxn],a[maxn];
long long tree[maxn];
int n;
inline int lowbit(int ...
分类:
其他好文 时间:
2014-07-22 00:27:36
阅读次数:
210
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 an...
分类:
其他好文 时间:
2014-07-21 14:35:26
阅读次数:
206
0. java学习必看,你的大方向http://java.itcast.cn/subject/hadoop2/index.shtml?140701lcqqq1
1、JDK6中文API:http://tool.oschina.net/apidocs/apidoc?api=jdk-zh
2、Netty4.x用户向导:http://netty.io/wiki/user-guide-for-4.x....
分类:
编程语言 时间:
2014-07-21 13:35:49
阅读次数:
234
线段树的一般模板,1.结构体数组tree来存储 2.线段树的构建函数buildTree 3.改变元素值函数update 4.查询区间内总和的函数query全部使用递归来实现
######################################################################include
#include
#include
#include
us...
分类:
其他好文 时间:
2014-07-21 11:44:15
阅读次数:
183
本文出自:http://blog.csdn.net/svitter
分析:vector是STL模板中的容器。可以利用其性质来构建邻接表。
定义:
#include
#define MAXN 10000
//max n of a tree or graph
//if is a tree, n / 2 is OK ;
using namespace std;
typedef ve...
分类:
其他好文 时间:
2014-07-21 11:27:55
阅读次数:
228
复制解决的问题是保持多个服务器之间的数据的一致性,就如同通过复制保持两个文件的一致性一样,只不过MySQL的复制要相对要复杂一些,其基本过程如下: 1)在主库上将数据更改记录到二进制日志(Binary Log)中(这些记录被成为二进制日志事件,即binlog) 2)本分将主库上的日志复制到自...
分类:
数据库 时间:
2014-07-21 11:23:00
阅读次数:
300