ArrayList和LinkedList区别

相同点:

        ArrayList和LinkedList这两个类都属于list接口下面的实现类。

不同点:

        ArrayList是基于动态数组,LinkedList是基于链表的数据结构。

        对于随机get和setArrayList的效率高于LinkedList,因为LinkedList要移动指针。

        对于新增和删除add和remove,LinkedList的速度要高于ArrayList,因为ArrayList要移动元素。

你可能感兴趣的:(ArrayList和LinkedList区别)