java ArrayList和LinkedList区别

ArrayList和LinkedList的大致区别如下:
1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。
2.对于随机访问get和set,ArrayList觉得优于LinkedList,因为LinkedList要移动指针。O(n)
3.对于新增和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动数据。

参照地址

猜你喜欢

转载自blog.csdn.net/ppwwp/article/details/86484434