05 2015 档案

摘要:public class Solution { public boolean isValid(String s) { if(s==null || s.length() st = new Stack(); for(int i=0;i<s.length();i++){ ... 阅读全文
posted @ 2015-05-31 08:08 世界到处都是小星星 阅读(122) 评论(0) 推荐(0)
摘要:看了一天电影果然弱智啊这么简单的题目居然bugpublic class Solution { public boolean containsNearbyDuplicate(int[] nums, int k) { if(nums==null||nums.length hm = n... 阅读全文
posted @ 2015-05-30 05:41 世界到处都是小星星 阅读(146) 评论(0) 推荐(0)
摘要:一道非常经典的dfspublic class Solution { String[] keybd ={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; // http://www.cnblogs.com/springfor... 阅读全文
posted @ 2015-05-29 12:17 世界到处都是小星星 阅读(158) 评论(0) 推荐(0)
摘要:public class Solution { public String longestCommonPrefix(String[] strs) { //http://www.cnblogs.com/springfor/p/3872316.html if(strs=... 阅读全文
posted @ 2015-05-29 08:45 世界到处都是小星星 阅读(98) 评论(0) 推荐(0)
摘要:烧脑神题public class Solution { public boolean isMatch(String s, String p) { // 反正我是想不出来 http://www.cnblogs.com/springfor/p/3893593.html ... 阅读全文
posted @ 2015-05-29 07:42 世界到处都是小星星 阅读(118) 评论(0) 推荐(0)
摘要:Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.public class Solution { public boolean isPalindrome(int ... 阅读全文
posted @ 2015-05-29 05:57 世界到处都是小星星 阅读(110) 评论(0) 推荐(0)
摘要:极值问题public class Solution { public int myAtoi(String str) { // 要考虑清楚极值问题 if(str==null || str.length()==0) return 0; int i=0, r... 阅读全文
posted @ 2015-05-29 05:44 世界到处都是小星星 阅读(188) 评论(0) 推荐(0)
摘要:这道题不考虑越界问题的话,最粗暴的解法public class Solution { public int reverse(int x) { int rev =0; while(x!=0){ rev =rev*10+x%10; ... 阅读全文
posted @ 2015-05-29 03:10 世界到处都是小星星 阅读(113) 评论(0) 推荐(0)
摘要:public class Solution { public String convert(String s, int numRows) { // http://www.cnblogs.com/springfor/p/3889414.html // 略无聊,就是斜角... 阅读全文
posted @ 2015-05-29 02:59 世界到处都是小星星 阅读(666) 评论(0) 推荐(0)
摘要:关键在于写好helperpublic class Solution { public String longestPalindrome(String s) { if(s==null) return null; if(s.length()==1) return s; ... 阅读全文
posted @ 2015-05-29 00:05 世界到处都是小星星 阅读(160) 评论(0) 推荐(0)
摘要:http://blog.dato.com/how-to-evaluate-machine-learning-models-part-1-orientationhttp://blog.dato.com/how-to-evaluate-machine-learning-models-part-2a-cl... 阅读全文
posted @ 2015-05-28 07:36 世界到处都是小星星 阅读(140) 评论(0) 推荐(0)
摘要:暂时理解不了二分那个算法O(n)public class Solution { public int minSubArrayLen(int s, int[] nums) { // http://bookshadow.com/weblog/2015/05/12/leetcode-m... 阅读全文
posted @ 2015-05-28 03:52 世界到处都是小星星 阅读(217) 评论(0) 推荐(0)
摘要:Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl... 阅读全文
posted @ 2015-05-27 08:27 世界到处都是小星星 阅读(172) 评论(0) 推荐(0)
摘要:完全抄答案class TrieNode { // Initialize your data structure here. // ref http://www.programcreek.com/2014/05/leetcode-implement-trie-prefix-tree-jav... 阅读全文
posted @ 2015-05-27 06:38 世界到处都是小星星 阅读(223) 评论(0) 推荐(0)
摘要:IYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping y... 阅读全文
posted @ 2015-05-27 04:43 世界到处都是小星星 阅读(168) 评论(0) 推荐(0)
摘要:dfs 参考I II, 切不要K sumFind all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combi... 阅读全文
posted @ 2015-05-27 03:50 世界到处都是小星星 阅读(197) 评论(0) 推荐(0)
摘要:http://www.datasciencecentral.com/profiles/blogs/10-python-machine-learning-projects-on-github 阅读全文
posted @ 2015-05-26 10:55 世界到处都是小星星 阅读(153) 评论(0) 推荐(0)
摘要:Real-time interactive movie recommendationhttp://fastml.com/real-time-interactive-movie-recommendation/ 阅读全文
posted @ 2015-05-26 10:54 世界到处都是小星星 阅读(117) 评论(0) 推荐(0)
摘要:refhttp://blog.jobbole.com/84876/ 阅读全文
posted @ 2015-05-26 10:53 世界到处都是小星星 阅读(108) 评论(0) 推荐(0)
摘要:public class Solution { public boolean containsDuplicate(int[] nums) { if(nums==null||nums.length==0) return false; Set s = new HashS... 阅读全文
posted @ 2015-05-26 05:29 世界到处都是小星星 阅读(117) 评论(0) 推荐(0)
摘要:public class Solution { public int[] findOrder(int numCourses, int[][] prerequisites) { int[] re =new int[numCourses] ; int can = 0;... 阅读全文
posted @ 2015-05-26 05:17 世界到处都是小星星 阅读(173) 评论(0) 推荐(0)
摘要:比较难的一道题,但是还是能看懂public class Solution { public List findRepeatedDnaSequences(String s) { // ref http://blog.csdn.net/haiyi727/article/details... 阅读全文
posted @ 2015-05-22 05:49 世界到处都是小星星 阅读(143) 评论(0) 推荐(0)
摘要:public class Solution { public ArrayList grayCode(int n) { if(n==0){ ArrayList res = new ArrayList(); res.add(0); ... 阅读全文
posted @ 2015-05-22 04:18 世界到处都是小星星 阅读(104) 评论(0) 推荐(0)
摘要:public class Solution { // you need to treat n as an unsigned value public int hammingWeight(int n) { int res = 0; while(n!=0){ ... 阅读全文
posted @ 2015-05-22 03:48 世界到处都是小星星 阅读(95) 评论(0) 推荐(0)
摘要:>>是无符号移位public class Solution { // you need treat n as an unsigned value // http://blog.csdn.net/woliuyunyicai/article/details/44198311 publi... 阅读全文
posted @ 2015-05-22 03:41 世界到处都是小星星 阅读(99) 评论(0) 推荐(0)
摘要:refhttp://bigdata-madesimple.com/decoding-dimensionality-reduction-pca-and-svd/ 阅读全文
posted @ 2015-05-21 06:49 世界到处都是小星星 阅读(116) 评论(0) 推荐(0)
摘要:位操作public class Solution { public int rangeBitwiseAnd(int m, int n) { // ref http://www.cnblogs.com/grandyang/p/4431646.html // 位操作运算... 阅读全文
posted @ 2015-05-21 06:05 世界到处都是小星星 阅读(91) 评论(0) 推荐(0)
摘要:关键是想清楚每一个课 A 都对应一个neighbor list,即是 A的后续课程 set{b,c,d,...}讲解http://blog.csdn.net/dm_vincent/article/details/7714519每次是剪掉一个“入点”,即non-pre的初始课,然后剪掉它对应的edge... 阅读全文
posted @ 2015-05-20 11:42 世界到处都是小星星 阅读(268) 评论(0) 推荐(0)
摘要:why list cannot be hash's keyhttps://wiki.python.org/moin/DictionaryKeysLooking up different lists with the same contents would produce different resu... 阅读全文
posted @ 2015-05-19 23:16 世界到处都是小星星 阅读(111) 评论(0) 推荐(0)
摘要:开始就想偏了,abcd那些字符根本不用构建,用hashmap一一对应做refhttp://blog.csdn.net/fightforyourdream/article/details/17311575public class Solution { public boolean isIsomo... 阅读全文
posted @ 2015-05-19 22:10 世界到处都是小星星 阅读(142) 评论(0) 推荐(0)
摘要:两种做法,都要考虑好结尾处和怎么连接的iterativelyif(head ==null || head.next ==null) return head; ListNode h = new ListNode(-1); h.next = head; Li... 阅读全文
posted @ 2015-05-19 13:18 世界到处都是小星星 阅读(102) 评论(0) 推荐(0)
摘要:好久不练手了,注意boolean array default 是falsepublic class Solution { public int countPrimes(int n) { if(n<=2) return 0; boolean[] a = ne... 阅读全文
posted @ 2015-05-19 07:39 世界到处都是小星星 阅读(111) 评论(0) 推荐(0)
摘要:processhttp://scikit-learn.org/dev/tutorial/basic/tutorial.htmlcodehttp://scikit-learn.org/dev/auto_examples/classification/plot_digits_classification... 阅读全文
posted @ 2015-05-14 11:57 世界到处都是小星星 阅读(121) 评论(0) 推荐(0)
摘要:安装python 和pip,注意一定要添加路径 check, 如youtube所示https://www.youtube.com/watch?v=yHtFeEZEexchttp://arunrocks.com/guide-to-install-python-or-pip-on-windows/用pi... 阅读全文
posted @ 2015-05-14 08:31 世界到处都是小星星 阅读(136) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/zhandoushi1982/article/details/8458081 阅读全文
posted @ 2015-05-08 12:14 世界到处都是小星星 阅读(76) 评论(0) 推荐(0)
摘要:public class primeNum { public static void main(String[] args) { // TODO Auto-generated method stub int N =100; boolean[] a=new boolean[N+1]... 阅读全文
posted @ 2015-05-07 06:56 世界到处都是小星星 阅读(231) 评论(0) 推荐(0)
摘要:http://www.tldp.org/LDP/nag2/index.html 阅读全文
posted @ 2015-05-06 05:49 世界到处都是小星星 阅读(126) 评论(0) 推荐(0)