题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题解: 1 ...
分类:
编程语言 时间:
2014-08-01 06:56:41
阅读次数:
228
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:之前做过一道是从sorted array转换到BinarySearc....
分类:
编程语言 时间:
2014-08-01 04:54:21
阅读次数:
310
Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.题意:翻转...
分类:
其他好文 时间:
2014-08-01 04:47:01
阅读次数:
176
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:
其他好文 时间:
2014-08-01 04:40:11
阅读次数:
166
/*
中文题意:
中文翻译:
题目大意:求循环的次数。
解题思路:如下:
难点详解:画表会发现和杨辉三角有点像,这就有了写下去的希望。但输出时m和n不一样,这样就要在调试中发现规律,才可输出正确的结果。
关键点:画表格,从中发现规律,进而解答这题。
解题人:lingnichong
解题时间:2014/08/01 00:08
解题感受:当时没写出来,后来会长说了一下,有了一...
分类:
其他好文 时间:
2014-08-01 02:27:40
阅读次数:
240
解题报告
题意:
替换字符串,一个单词可重复替换
思路:
这种题都很恶心。
#include
#include
#include
#include
using namespace std;
char str[1000][1000],ch[1000][1000],sh[1000],str1[1000];
int main()
{
int n,i,j;
while(~...
分类:
其他好文 时间:
2014-08-01 00:05:00
阅读次数:
351
刘汝佳《算法竞赛入门经典(第2版)》第三章数组和字符串中,所有UVa习题的题解汇总。...
分类:
其他好文 时间:
2014-08-01 00:04:50
阅读次数:
335
在linux系统下长时间进行性能测试,连续几次发现服务器假死无法连接上的情况,无奈只能重启服务器。在测试路径下发现hs_err_pid17285.log文件,打开文件查看其主要内容如下:# There is insufficient memory for the Java Runtime Environment to continue.# Cannot create GC thread. Out...
分类:
编程语言 时间:
2014-07-31 23:57:00
阅读次数:
641
dp[i][j][s]表示第i个人,在前j个问题解决了s个问题dp[i][j][s]=dp[i][j-1][s-1]*p[i][j]+dp[i][j-1][s]*(1-p[i][j]); 1 #include 2 #include 3 #include 4 #include 5 #include 6...
分类:
其他好文 时间:
2014-07-31 23:51:10
阅读次数:
290
这一年的前三题虽然难度不高,但是第二题极为繁琐,想在考场上用较短的时间拿到第二题的分数难上加难。所以必须要调整策略,争取拿其他三题的分数。第四题是比较普通的搜索题,分数比较好拿,但是很容易想成树形DP,就只能拿30~50分。第一题:神经网络模拟有几个注意点:输入层(即第一层)的结点的U(阈值)是没有...
分类:
其他好文 时间:
2014-07-31 23:16:00
阅读次数:
257