Given a singly linked list where elements are
sorted in ascending order, convert it to a height balanced BST.1.
将LinkedList的值保存到一个数组中,转化成Convert Sorte...
分类:
其他好文 时间:
2014-05-12 05:53:09
阅读次数:
367
原题地址:http://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/题意:Given
a binary tree, flatten it to a linked list in-place.For example,Given...
分类:
编程语言 时间:
2014-05-12 05:30:32
阅读次数:
367
http://www.tutorialspoint.com/java/index.htm
分类:
编程语言 时间:
2014-05-12 01:56:12
阅读次数:
244
原题地址:http://oj.leetcode.com/problems/sum-root-to-leaf-numbers/题意:Given
a binary tree containing digits from0-9only, each root-to-leaf path could
repre...
分类:
编程语言 时间:
2014-05-12 01:28:30
阅读次数:
440
一直没有点动态树这个科技树,因为听说只能用Splay,用Treap的话多一个log。有一天脑洞大开,想到也许Treap也能从底向上Split。仔细思考了一下,发现翻转标记不好写,再仔细思考了一下,发现还是可以写的,只需要实时交换答案二元组里的两棵树,最后在吧提出来的访问节点放回去就行了。本着只学.....
分类:
其他好文 时间:
2014-05-11 22:56:42
阅读次数:
605
题意:417 - Word Index
题意:每个字符串按题目中那样去映射成一个数字,输入字符串,输出数字
思路:这题还是比较水的,由于一共只有83000多个数字,所以对应一个个数字去映射就可以了,注意字符串进位的情况处理即可
代码:
#include
#include
#include
#include
using namespace std;
char str[10];
ma...
分类:
其他好文 时间:
2014-05-11 20:49:23
阅读次数:
428
$(document).ready(function () { var
tag=$(".tags"); tag.mouseover(function(){
$(this).addClass("tagOn").siblings().removeClass("tagOn"); var index ...
分类:
Web程序 时间:
2014-05-11 18:22:45
阅读次数:
415
最近公司项目使用WebService ,这里简单做个总结。
公共接口很多:http://www.webxml.com.cn/zh_cn/index.aspx
这里使用获取天气接口:
直接上代码吧。比较简单,由于时间关系,没有详细做。但是大体上如何使用应该还是可以看的出来。但,还是研究比较深要好点。
项目结构图:
package com.example.ut...
分类:
Web程序 时间:
2014-05-11 03:29:20
阅读次数:
534
题目
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,...
分类:
其他好文 时间:
2014-05-11 03:25:24
阅读次数:
298
链接:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1039
Description
前段时间,某省发生干旱,B山区的居民缺乏生活用水,现在需要从A城市修一条通往B山区的路。假设有A城市通往B山区的路由m条连续的路段组成,现在将这m条路段承包给n个工程队(n ≤ m ...
分类:
其他好文 时间:
2014-05-11 02:35:40
阅读次数:
369