Welcome to Git (version 1.9.4-preview20140611)Run 'git help git' to display the help index.Run 'git help ' to display help for specific commands.Tingk...
分类:
其他好文 时间:
2014-07-27 22:19:09
阅读次数:
189
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2014-07-27 22:03:49
阅读次数:
214
本文主要讨论二叉树相关算法的C语言实现,包括树的创建、三种方式遍历(递归与非递归)、输出叶结点、计算树的深度、树形输出、按层缩进输出、按层顺序输出、计算从根到指定结点的路径
分类:
其他好文 时间:
2014-07-27 22:02:59
阅读次数:
299
题目来源:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1549 并查集,求出每个friends集合,然后再计算每个集合friends个数,求出最...
分类:
其他好文 时间:
2014-07-27 22:01:29
阅读次数:
234
官方搭建步骤: http://developer.android.com/index.html搭建好开发环境之前须要下载以下几个文件包:一、安装Java执行环境JRE(没这个Eclipse执行不起来)和JDK 官网下载 http://www.oracle.com/technetwork/java/....
分类:
移动开发 时间:
2014-07-27 21:52:09
阅读次数:
311
简单的线段树,多余的就不解释了。 1 #include 2 #include 3 4 using namespace std; 5 #define INF 0xffffff0 6 #define max(a,b) (a>b?a:b) 7 #define min(a,b) (a Tree[root]....
分类:
其他好文 时间:
2014-07-27 21:37:10
阅读次数:
216
在搭建struts2框架时jsp页面的如果struts.xml文件中配置了namespace="/login"上面的action属性不能加.action后缀如果struts.xml文件中没有配置namespace则需要加上.action * index.jsp直接指向login.jsp,通过访问.....
分类:
移动开发 时间:
2014-07-27 21:36:25
阅读次数:
227
题意: 树的前,中序遍历求后序遍历。基础题。code#include #include using namespace std;string sq, sh;int len;void make (int l, int r, int t, int w) { if (l > r || t > w) r.....
分类:
其他好文 时间:
2014-07-27 21:34:05
阅读次数:
195
UVA 10410 - Tree Reconstruction
题目链接
题意:给定一个树的dfs序列和bfs序列,求出这颗树
思路:拿dfs的序列,分成若干段,每一段相当一个子树,这样就可以利用bfs的序列去将dfs的序列分段,然后利用一个队列去存放每一段,不断求出子树即可。一开始以为parse tree一定是二叉树,原来不一定啊。
代码:
#include
#i...
分类:
其他好文 时间:
2014-07-27 11:49:23
阅读次数:
155
递归输出就行了
#include
using namespace std;
struct tree{
int dot;
string s;
}t[1020];
int si[1020],a[1020][1020];
void print(int x)
{
for(int i=0;i<=si[x]-1;i++)
{
for(int j=1;j<=t[...
分类:
其他好文 时间:
2014-07-27 11:48:53
阅读次数:
188