ArrayList/LinkedList/vector的异同?
ArrayList和LinkedList的异同
二者都是线程不安全的,相对于线程安全的Vector,执行效率高。
ArrayList是实现了基于动态数组的数据结构,LinkedList是基于链表的数据结构。
对于随机访问get和set,ArrayList优于LinkedList,因为LinkedList要移动指针
对于新增(特质插入)add和删除remove操作,LinkedList占优,因为ArrayList要移动数据。
ArrayList和Vector的异同
Vector和ArrayList几乎是
原创
2021-03-22 15:53:34 ·
85 阅读 ·
0 评论