摘要: import java.util.Arrays; import java.util.List; /** * * 本类演示了Arrays类中的asList方法 * 通过四个段落来演示,体现出了该方法的相关特性. * * (1) 该方法对于基本数据类型的数组支持并不好,当数组是基本数据类型时不建议使用 * (2) 当使用asList()方法时,数组就和列表链接在一起了. * ... 阅读全文
posted @ 2016-04-02 21:03 winAlaugh 阅读(364) 评论(0) 推荐(0)
摘要: 思路先遍历整个链表得到长度,然后根据总长度和K得到节点到头结点的距离 /* public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } }*/ public class So 阅读全文
posted @ 2016-04-02 20:59 winAlaugh 阅读(332) 评论(0) 推荐(0)
摘要: 我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法 1 利用数组结构遍历方法 if(target==1 || target==0) return 1; int [] arr = new int [target+1]; arr 阅读全文
posted @ 2016-04-02 11:43 winAlaugh 阅读(377) 评论(0) 推荐(0)