您的位置:首页 > Web前端

Java: Difference between ArrayList and LinkedList

2015-08-03 11:32 387 查看
Basically, they are just two different implementations of List interface.

LinkedList is implemented with a double-linked list; ArrayList is implemented with a dynamically resizing array.

所以基本的区别于list和array的区别很像,就是for random access, ArrayList is better; for adding and deleting, LinkedList is better.

LinkedList takes more space since it has to store both previous and next pointer. So large lists prefer arrayList.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: