Difference between ArrayList and LinkedList in java

 

  1, the bottom layer of ArrayList is implemented using arrays

  2, the bottom layer of LinkedList is implemented with linked list

  3. In actual development, if data is read frequently, and insertion and deletion are infrequent, use ArrayList

  4 , if insertion and deletion are frequent, use LinkedList

  5. For random access get and set, ArrayList feels better than LinkedList, because LinkedList has to move the pointer. 
  
6. For the add and remove operations add and remove, LinedList is more dominant, because ArrayList needs to move data.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324813731&siteId=291194637