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++){ ...
阅读全文
摘要:看了一天电影果然弱智啊这么简单的题目居然bugpublic class Solution { public boolean containsNearbyDuplicate(int[] nums, int k) { if(nums==null||nums.length hm = n...
阅读全文
摘要:一道非常经典的dfspublic class Solution { String[] keybd ={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; // http://www.cnblogs.com/springfor...
阅读全文
摘要:public class Solution { public String longestCommonPrefix(String[] strs) { //http://www.cnblogs.com/springfor/p/3872316.html if(strs=...
阅读全文
摘要:烧脑神题public class Solution { public boolean isMatch(String s, String p) { // 反正我是想不出来 http://www.cnblogs.com/springfor/p/3893593.html ...
阅读全文
摘要:Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.public class Solution { public boolean isPalindrome(int ...
阅读全文
摘要:极值问题public class Solution { public int myAtoi(String str) { // 要考虑清楚极值问题 if(str==null || str.length()==0) return 0; int i=0, r...
阅读全文
摘要:这道题不考虑越界问题的话,最粗暴的解法public class Solution { public int reverse(int x) { int rev =0; while(x!=0){ rev =rev*10+x%10; ...
阅读全文
摘要:public class Solution { public String convert(String s, int numRows) { // http://www.cnblogs.com/springfor/p/3889414.html // 略无聊,就是斜角...
阅读全文
摘要:关键在于写好helperpublic class Solution { public String longestPalindrome(String s) { if(s==null) return null; if(s.length()==1) return s; ...
阅读全文
摘要: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...
阅读全文
摘要:暂时理解不了二分那个算法O(n)public class Solution { public int minSubArrayLen(int s, int[] nums) { // http://bookshadow.com/weblog/2015/05/12/leetcode-m...
阅读全文
摘要: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...
阅读全文
摘要:完全抄答案class TrieNode { // Initialize your data structure here. // ref http://www.programcreek.com/2014/05/leetcode-implement-trie-prefix-tree-jav...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:http://www.datasciencecentral.com/profiles/blogs/10-python-machine-learning-projects-on-github
阅读全文
摘要:Real-time interactive movie recommendationhttp://fastml.com/real-time-interactive-movie-recommendation/
阅读全文
摘要:refhttp://blog.jobbole.com/84876/
阅读全文
摘要:public class Solution { public boolean containsDuplicate(int[] nums) { if(nums==null||nums.length==0) return false; Set s = new HashS...
阅读全文
摘要:public class Solution { public int[] findOrder(int numCourses, int[][] prerequisites) { int[] re =new int[numCourses] ; int can = 0;...
阅读全文
摘要:比较难的一道题,但是还是能看懂public class Solution { public List findRepeatedDnaSequences(String s) { // ref http://blog.csdn.net/haiyi727/article/details...
阅读全文
摘要:public class Solution { public ArrayList grayCode(int n) { if(n==0){ ArrayList res = new ArrayList(); res.add(0); ...
阅读全文
摘要:public class Solution { // you need to treat n as an unsigned value public int hammingWeight(int n) { int res = 0; while(n!=0){ ...
阅读全文
摘要:>>是无符号移位public class Solution { // you need treat n as an unsigned value // http://blog.csdn.net/woliuyunyicai/article/details/44198311 publi...
阅读全文
摘要:refhttp://bigdata-madesimple.com/decoding-dimensionality-reduction-pca-and-svd/
阅读全文
摘要:位操作public class Solution { public int rangeBitwiseAnd(int m, int n) { // ref http://www.cnblogs.com/grandyang/p/4431646.html // 位操作运算...
阅读全文
摘要:关键是想清楚每一个课 A 都对应一个neighbor list,即是 A的后续课程 set{b,c,d,...}讲解http://blog.csdn.net/dm_vincent/article/details/7714519每次是剪掉一个“入点”,即non-pre的初始课,然后剪掉它对应的edge...
阅读全文
摘要:why list cannot be hash's keyhttps://wiki.python.org/moin/DictionaryKeysLooking up different lists with the same contents would produce different resu...
阅读全文
摘要:开始就想偏了,abcd那些字符根本不用构建,用hashmap一一对应做refhttp://blog.csdn.net/fightforyourdream/article/details/17311575public class Solution { public boolean isIsomo...
阅读全文
摘要:两种做法,都要考虑好结尾处和怎么连接的iterativelyif(head ==null || head.next ==null) return head; ListNode h = new ListNode(-1); h.next = head; Li...
阅读全文
摘要:好久不练手了,注意boolean array default 是falsepublic class Solution { public int countPrimes(int n) { if(n<=2) return 0; boolean[] a = ne...
阅读全文
摘要:processhttp://scikit-learn.org/dev/tutorial/basic/tutorial.htmlcodehttp://scikit-learn.org/dev/auto_examples/classification/plot_digits_classification...
阅读全文
摘要:安装python 和pip,注意一定要添加路径 check, 如youtube所示https://www.youtube.com/watch?v=yHtFeEZEexchttp://arunrocks.com/guide-to-install-python-or-pip-on-windows/用pi...
阅读全文
摘要:http://blog.csdn.net/zhandoushi1982/article/details/8458081
阅读全文
摘要:public class primeNum { public static void main(String[] args) { // TODO Auto-generated method stub int N =100; boolean[] a=new boolean[N+1]...
阅读全文
摘要:http://www.tldp.org/LDP/nag2/index.html
阅读全文
浙公网安备 33010602011771号