码迷,mamicode.com
首页 >  
搜索关键字:sorted list ii    ( 64619个结果
leetcode Remove Nth Node From End of List
题目说:Try to do this in one pass 只用一遍遍历的话,p1先走n节点,p2再走,等到p1到达链表尾的时候p2正好在倒数第n+1个上面鸟 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode...
分类:其他好文   时间:2014-05-23 01:52:29    阅读次数:331
001. 3和5的倍数
Problem 1: Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multip...
分类:其他好文   时间:2014-05-23 01:43:01    阅读次数:253
[LeetCode]Remove Duplicates from Sorted Array
Remove Duplicates from Sorted Array...
分类:其他好文   时间:2014-05-22 23:06:48    阅读次数:271
要点Java19 java.util.Arrays
Arrays 数组帮助类 示例程序(JUnit演示) 数组转化为List @Test public void testUserArraysChangeArraytoList() { // 类Arrays // public static List asList(T... a) // Returns a fixed-s...
分类:编程语言   时间:2014-05-22 18:37:40    阅读次数:354
LeetCode: Permutations II [046]
【题目】 Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following unique permutations: [1,1,2], [1,2,1], and [2,1,1]. 【题意】 给定一个候选数集合,候选集中可能存在重复数,返回所有的排列 【思路】 ...
分类:其他好文   时间:2014-05-22 17:32:17    阅读次数:247
LeetCode: Jump Game II [044]
【题目】 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of ju...
分类:其他好文   时间:2014-05-22 17:02:20    阅读次数:244
SnakeGo : Scaling Screen on Stage II
昨晚把BaseScreen就敲好了, 也找到了屏幕放缩的最优和最简方式. 不多说, 看代码: public BaseScreen(final SnakeGo game) { super(new ScalingViewport(Scaling.fit, CommonConsts.Screen.WIDT...
分类:其他好文   时间:2014-05-22 14:52:32    阅读次数:206
UnderScore.jsAPI记录
Collection Functions (Arrays or Objects)each _.each(list, iterator, [context])遍历list中的所有元素,如果传递了context参数,则把iterator绑定到context对象上。iterator的参数是(valu...
分类:Windows程序   时间:2014-05-22 14:32:08    阅读次数:649
建议10:必须知道如何实现类比较器 接口实现对象排序
建议10:必须知道如何实现类比较器所谓的比较器就只是一个接口,也只需要实现一个方法(public int CompareTo(object obj)).实现了比较器有什么用呢?除了顾名思义的可以比较两个实例的大小.还可以用来排序(比如是List集合,就直接调用.Sort()方法就可以 了.方便至极....
分类:其他好文   时间:2014-05-22 14:29:37    阅读次数:186
java开始到熟悉105-107
1,HashMap基本用法 1 package list; 2 3 import java.util.HashMap; 4 import java.util.Map; 5 6 /** 7 * 测试map的基本用法 8 * @author acer 9 *10 */11 public cl...
分类:编程语言   时间:2014-05-22 14:27:29    阅读次数:459
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!