ArrayList and LinkedList similarities and differences

ArrayList and LinkedList similarities and differences

    From the infrastructure view:

      ArrayList is the underlying array , while performing addition and deletion operations, elements to be moved back one by one;

      LinkedList and the bottom is doubly linked list, in performing additions and deletions, is directly operated by the pointer, more efficient

      Therefore, ArrayList for more queries , while LinkedList for more deletions, additions

 

 

    On thread-safe:

      Both are not thread safe in

 

 

    From the point of view access methods:

      Since ArrayList array is based, it can be by way of an index value to locate the position of the element

      And only through the LinkedList pointer slowly find

 

    

Guess you like

Origin www.cnblogs.com/javaisbest/p/11795444.html