Details parse the difference between collections and collections and arrays in java

Arrays and linked lists

  1. Array: an array is a collection of so-called the same type of data elements arranged in a certain order.
    Its storage intervals are contiguous, memory for serious, so space complexity is very large, o (n), but the array of binary search time complexity is small o (1), characterized by a fixed size can not be changed, in the same array can hold only a single type of data, easy addressing, inserting and deleting difficulties.
  2. List: the list is called a physically non-contiguous memory cells, non-sequential storage structure, the logical order of the data elements in the linked list pointer is implemented.

Guess you like

Origin www.cnblogs.com/jasonboren/p/11115793.html