一般大家都知道ArrayList和LinkedList的大致区别:1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。2.对于随机访问get和set,ArrayList觉得优于LinkedList,因为LinkedList要移动指针。3.对于新增和删除操作add和remove,LinedList比较占优势,因为..
分类:
编程语言 时间:
2014-08-14 04:00:28
阅读次数:
457
1、git init该命令执行之后并没有创建branch2、git add添加文件,这时branch 也还没生成。git branch name也没用3、git commit提交到git repo,产生默认的master分支,并且有一个HEAD pointer指向master4、git branch...
分类:
其他好文 时间:
2014-08-14 01:20:27
阅读次数:
233
一.引言本文主要记录的是C#各种集合操作的性能,下面的标记说明描述标记的时间,下面的表格对比各种集合各种操作的时间.标记说明:O(1)表示无论集合中有多少项,这个操作需要的时间都不变,例如,ArraryLIst的Add()方法就O(1),无论集合中有多少元素,在列表尾部添加一个新的元素的时间都是相同...
分类:
其他好文 时间:
2014-08-14 01:05:57
阅读次数:
222
UVA 12096 - The SetStack Computer
题目链接
题意:几个操作,push是在栈顶加入一个空集,dup是复制栈顶集合,在放入栈顶,union是把头两个取并集放回,int是头两个取交集放回,add是取头两个,把第一个当成一个集合加入第二个,每次操作输出栈顶集合的里面的个数
思路:用set,stack模拟,然后利用map去hash一个集合,模拟即可
...
分类:
其他好文 时间:
2014-08-13 22:30:07
阅读次数:
370
一、Cookie设置 cookieHttpCookie cookie = new HttpCookie(name);cookie.Value = user.UserID.ToString();Response.Cookies.Add(cookie);读取cookieSystem.Web.HttpCo...
分类:
其他好文 时间:
2014-08-13 21:54:28
阅读次数:
174
zmalloc.o: In function `zmalloc_used_memory':/home/cqh/tar/redis-2.6.14/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4'collect2: ld...
分类:
其他好文 时间:
2014-08-13 21:41:57
阅读次数:
996
alter table tablename add constraint unionkeyname primary key (column1,column2);
上面语句中:
tablename为要添加联合约束的表
unionkeyname为添加的联合约束的名称
column1,column2为联合主键作用的两个列列名...
分类:
数据库 时间:
2014-08-13 19:01:07
阅读次数:
212
从已有的GIT仓库获取最新代码git clone url建立本地仓库,并提交至git-hub生成ssh的公钥私钥对:ssh-keygen从pc端打开生成的公钥,id_rsa.pub,复制并黏贴至git-hub的ssh-keyscd至程序文件夹,输入 git init然后输入git add .(.代表...
分类:
其他好文 时间:
2014-08-13 18:41:56
阅读次数:
210
题解:首先是很基础的树状数组求逆序对,然后对于每一个第一个数往后移动,对于逆序数的贡献是n-a[i]-1-a[i]。枚举然后求最小值即可。#include #include #include using namespace std;int n,c[5001],x,a[5001];int add(in...
分类:
其他好文 时间:
2014-08-13 17:46:06
阅读次数:
255
横竖屏切换,不重新加载
Up to API 13 there was a new value to the configChanges attribute, screenSize
So if you're using large screens make sure to add screenSize in your configChanges attribute:
android:confi...
分类:
移动开发 时间:
2014-08-13 15:02:36
阅读次数:
251