请问ArrayList、LinkedList、Vector的区别
①ArrayList底层实际上是采用数组实现的(并且该数组的类型的Object类型的)
②如果jdk6,采用Array.copyOf()方法来生成一个新的数组,如果是jdk5,采用的是System.arraycopy()方法(当添加的数据量大于数组的长度时候)
③List list = newArrayList()时,底层会生成一个长度为10的数组来存放对象
④ArrayList、Vector底层都是采用数组实现的
⑤对于ArrayLis...
分类:
编程语言 时间:
2014-06-03 04:20:31
阅读次数:
304
1.使用命令:
chflags nohidden ~/library/ 使隐藏的资源库文件夹显示出来。如果想要隐藏掉,使用:chflags hidden ~/library/
2.finder中找到:用户->mwsn(这是我的用户名)->资源库->Application Support->iPhone Simulator->7.0(根据你的版本确定是哪个)->Applications
里面...
分类:
移动开发 时间:
2014-06-03 01:40:08
阅读次数:
288
问题:
返回N皇后问题解的个数。
分析:
详见 N-queens
实现:
bool nextPermutation(vector &num)
{
int i = num.size() - 1;
while (i >= 1)
{
if(num[i] > num[i - 1])
{
--i;
int ii = num.size() - 1;
while (i...
分类:
其他好文 时间:
2014-06-01 18:24:45
阅读次数:
398
The Game of Coins
mark:
#include"cstdio"
#include"iostream"
#include"queue"
#include"algorithm"
#include"set"
#include"queue"
#include"cmath"
#include"string.h"
#include"vector...
分类:
其他好文 时间:
2014-06-01 13:58:31
阅读次数:
196
这是一个静态插值算法的效果,图形学中插值算法应用十分广,如动画,photoshop, autocAD等软件画曲线,还有shader中的渐变上色也是一个硬件支持的插值算法。
Interpolation是很低层的算法,在图形学中可以说无处不在。
本程序通过设置两个vector,然后就可以在这两个vector之间插入点,得到不同的效果
如两个vector不同长度可以得到:
如果长...
分类:
其他好文 时间:
2014-06-01 10:54:54
阅读次数:
260
1.修改PagerTabStrip中的背景颜色我们在布局中直接设置background属性即可: <android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="fill_paren...
分类:
移动开发 时间:
2014-05-31 23:42:11
阅读次数:
624
1.File ---- Import---- Existing Android Code
Into
Workspace2.选择/extras/android/support/v7/appcompat/导入进来3.去github上查找,“platform
framework support”,下载下来...
分类:
移动开发 时间:
2014-05-31 18:46:40
阅读次数:
312
从3月底开始申请,整理J1的材料,一直到现在VISA的status变成了issued,中间被check了20多天,终于快要可以去silicon
valley了。废话不多说,J1签证很easy,不要有任何担心。直接上J1办理流程:1. 联系学校,拿到DS2019表、financial support
...
分类:
其他好文 时间:
2014-05-31 18:41:23
阅读次数:
279