数组和链表到底有什么区别?What is the difference between linkedlist and arraylist?

  1. different implementation
    arraylist uses dynamic array and linkedlist uses doubly linkedlist
  2. different storage ways:
    arraylist stores its elements in memory consecutively, but linkedlist don’t have to because of the pointers.
  3. different interface it implemented.
    arraylist implement list interface and linkedlist implement list interface and deque interface.
  4. different using scenarios:
    arraylist works better when we have large demand on access random data, linkedlist works better when the application demands manipulation of the stored data.
posted @ 2020-10-28 07:28  EvanMeetTheWorld  阅读(18)  评论(0)    收藏  举报