https://leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equ...
分类:
其他好文 时间:
2015-05-02 13:38:23
阅读次数:
137
相关代码请戳 https://coding.net/u/tiny656/p/LightOJ/git 1006 Hex-a-bonacci. 用数组模拟记录结果,注意取模 1008 Fibsieve's Fantabulous Birthday. 找规律题,左边列是1 3平方 5平方......下边行...
分类:
其他好文 时间:
2015-05-02 12:24:05
阅读次数:
172
Problem DescriptionAfter inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have ...
分类:
其他好文 时间:
2015-05-02 12:20:50
阅读次数:
90
题目在这里:https://leetcode.com/problems/two-sum/【标签】Array; Hash Table【个人分析】 这个题目,我感觉也可以算是空间换时间的例子。如果是O(n^2)的那种思路,就是对于一个数字,去扫剩下的所有数字,看有没有能够加起来和为target的组合.....
分类:
编程语言 时间:
2015-05-01 07:07:25
阅读次数:
148
题目在这里https://leetcode.com/problems/rotate-image/【个人分析】 这个题目,我觉得就是考察基本功、考察细心的,算法方面没有太多东西,但是对于坐标的使用有较高要求。 放了两个版本的答案,第一个版本是自己写的,第二个是目前最佳答案的Java改写。【代码注...
分类:
编程语言 时间:
2015-05-01 07:05:17
阅读次数:
147
https://leetcode.com/problems/two-sum/
水题一发吧,不过退役以来很少做题了,真是退步太厉害,没考虑全
题意:给一个数组,也一个target,问哪两个数加起来可以得到target
答案:桶排orHash
1、注意,桶排序,而且桶的深度不一定是1,所以hash[i]表示i个数而不是是不是存在
2、因为涉及下标,所以一定小心数组的数可以是分数,我的做法是,...
分类:
其他好文 时间:
2015-05-01 01:50:43
阅读次数:
131
Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the probability...
分类:
其他好文 时间:
2015-04-30 21:57:25
阅读次数:
162
http://www.codeproject.com/Articles/552/Using-Worker-ThreadsIntroductionWorker threads are an elegant solution to a number of problems about concurren...
分类:
其他好文 时间:
2015-04-30 17:53:40
阅读次数:
93
点击打开杭电1024
Problem Description
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced wi...
分类:
其他好文 时间:
2015-04-30 12:38:42
阅读次数:
214
网址:https://leetcode.com/problems/palindrome-number/
题意:
判断int数是不是回文.
解法:
先遍历一遍,得到数值位数.
再前后判断是不是回文
注意不能是负数.
代码:
https://github.com/LiLane/leetcode/blob/master/c%2B%2B/009-PalindromeNumber-20150...
分类:
其他好文 时间:
2015-04-30 12:36:59
阅读次数:
126