1. ArrayList是基于动态数组的数据结构,LinkedList是基于链表的数据结构。
2. 对于随机访问get和set,ArrayList要优于LinkedList,因为LinkedList要移动指针。
3. 对于新增和删除操作,LinkedList要优于ArrayList,因为ArrayList要移动数据。
ArrayList与LinkedList的区别?
最新推荐文章于 2022-03-21 17:29:00 发布
1. ArrayList是基于动态数组的数据结构,LinkedList是基于链表的数据结构。
2. 对于随机访问get和set,ArrayList要优于LinkedList,因为LinkedList要移动指针。
3. 对于新增和删除操作,LinkedList要优于ArrayList,因为ArrayList要移动数据。