-
ArrayList的实现是基于动态数组的数据结构,LinkedList基于链表的数据结构。
-
对于随机访问get和set,ArrayList优于LinkedList,因为LinkedList要移动指针。
-
对于添加和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动数据。
ArrayList的实现是基于动态数组的数据结构,LinkedList基于链表的数据结构。
对于随机访问get和set,ArrayList优于LinkedList,因为LinkedList要移动指针。
对于添加和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动数据。