array数组,arraylist,hashset,vector,linkedlist,速度对比。
来源:互联网 发布:mac 没用 电池不充电 编辑:程序博客网 时间:2024/05/21 10:52
话不多说,数组多是用在知道大小的时候,如果不知道大小,当然从arraylist hashset vector linkedlist中选择一个
结果让我也有些意外
所有查找都是for each的形式,如果用正常的循环,linkedList的性能就会差非常大,而arraylist就会非常的快ArrayList查找到99998,所消耗的时间:853毫秒
数组插入到99998,所消耗的时间:1毫秒
数组查找到99998,所消耗的时间:813毫秒
ArrayList插入到99998,所消耗的时间:11毫秒
ArrayList查找到99998,所消耗的时间:3377毫秒
HashSet插入到99998,所消耗的时间:8毫秒
HashSet查找到99998,所消耗的时间:1745毫秒
Vector插入到99998,所消耗的时间:68毫秒
Vector查找到99998,所消耗的时间:9204毫秒
LinkedList插入到99998,所消耗的时间:14毫秒
LinkedList查找到99998,所消耗的时间:1594毫秒
竟然linkedlist是非常高速的数据结构,如果很计较插入速度arraylist最快,但是所消耗寻找时间也是最常
感谢http://blog.csdn.net/sharpyuce/archive/2007/11/07/1872114.aspx
- array数组,arraylist,hashset,vector,linkedlist,速度对比。
- Array、ArrayList、Vector、LinkedList
- ArrayList LinkedList Vector 对比
- ArrayList、LinkedList、Vector 对比
- LinkedList、ArrayList、Vector对比
- HashSet、HashMap、ArrayList、LinkedList、Vector
- Array / ArrayList / Vector / LinkedList / Hashmap
- HashSet、HashMap、ArrayList、LinkedList、Vector区别
- Array / ArrayList / Vector / LinkedList / Hashmap区别
- 集合框架 Vector LinkedList ArrayList HashSet LinkedHashSet TreeSet
- API--集合框架Vector集合,linkedList,ArrayList,HashSet集合
- 容器Collection的总结一 Vector ArrayList LinkedList HashSet TreeSet
- HashMap,HashSet,HashTable,LinkedHashMap,LinkedHashSet,ArrayList,LinkedList,ConcurrentHashMap,Vector
- 数组、Vector、List、ArrayList、LinkedList的区别
- 有关Array, ArrayList, LinkedList, Vector的学习笔记
- Collection,List,ArrayList,Vector,LinkedList(实现方式,对比)
- Vector,ArrayList与LinkedList
- 分清Vector、ArrayList、LinkedList
- [转]mysql性能的检查和调优方法
- IPMsg飞鸽传书网络协议解析手记
- 一个简单的非模式对话框在VC下的内存泄漏!
- 配置Eclipse3.3.2和EclipseMe1.7.9和JDK6.0,搭建J2ME开发平台
- 全文搜索 lucene使用与优化
- array数组,arraylist,hashset,vector,linkedlist,速度对比。
- 黑鹰
- vc2008编译提示找不到msvcr90d.dll
- ubuntu904安装sun-java6-jdk的问题
- pl/sql编程
- 网卡MAC地址是什么?
- Win32.Troj.Dimapg 是个什么东西?
- 《坦克大战》游戏c++ 需求
- JAVA内存溢出解析