List list = Arrays.asList(new Point(1, 5), new Point(2, 3),new Point(2, 8), new Point(9, 13));int sum = list.get(0).y - list.get(0).x,currenty=list.ge...
分类:
其他好文 时间:
2014-06-28 19:25:36
阅读次数:
183
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-06-25 23:01:44
阅读次数:
227
1.将数组转化为列表将数组转化为一个列表时,程序员们经常这样做:List list = Arrays.asList(arr);Arrays.asList()会返回一个ArrayList对象,ArrayList类是Arrays的一个私有静态类,而不是java.util.ArrayList类,java....
分类:
编程语言 时间:
2014-06-25 21:45:56
阅读次数:
373
本文主要想讲述一下我对之前看到一篇文章的说法。如果跟你的想法有出入,欢迎留言,一起讨论。
#3. 在循环中删除一个列表元素
考虑下面的代码,迭代过程中删除元素:
ArrayList list = new ArrayList(Arrays.asList("a", "b", "c", "d"));
for (int i = 0; i < list.size(); i++) {
li...
分类:
编程语言 时间:
2014-06-25 00:27:46
阅读次数:
293
题目链接:点击打开链接
题意:
给定n个箱子m个物品
下面n个数字表示箱子的容量
下面m个数字b1-bm 表示物品体积为2^bi大
问最多有多少个物品可以放入箱子。
思路:
贪心,先放小的,小的不能放再放大的
显然我们把n个箱子拆成二进制,然后模拟二进制减法运算。
剩下就是简单模拟
#include
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2014-06-24 18:52:56
阅读次数:
148
Cocos2d-x 脚本语言Lua基本数据结构-表(table) table是Lua中唯一的数据结构,其他语言所提供的数据结构,如:arrays、records、lists、queues、sets等,Lua都是通过table来实现,并且在lua中table很好的实现了这些数据结构。--摘自:《Programming in Lua》看以下代码,可以很清晰的明白Lua中表的使用:-- Lua中的表,t...
分类:
其他好文 时间:
2014-06-24 18:45:11
阅读次数:
258
今天在github 上面找到了一个关于如何正确使用javascript 来进行我们的程序开发.我就恬不知耻的来了个原创啊..坑爹啊.拿来和大家分享一下吧.
A mostly reasonable approach to Javascript.
Types //类型
Objects //对象
Arrays //数组
Strings //字符串
Fu...
分类:
编程语言 时间:
2014-06-22 19:13:40
阅读次数:
240
According to the order of data structure book, Arrays should be introduced in the frist time. When reviewing the some information related to arrays, I feel shocked that many useful classes and methods...
分类:
编程语言 时间:
2014-06-22 18:13:18
阅读次数:
316
Last night it took me about two hours to learn arrays. For the sake of less time, I did not put emphaises on the practice question, just now when reading the book, I found that some methods
referred...
分类:
其他好文 时间:
2014-06-22 17:14:10
阅读次数:
152
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space (size that is greater or equa...
分类:
其他好文 时间:
2014-06-20 15:25:50
阅读次数:
225