摘要:
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... 阅读全文