2013年8月4日星期日

Why ArrayList LinkedList slower than iteration ?

What is the root cause ???
------ Solution --------------------------------- -----------
ArrayList and Vector are stored using an array of data , the number of array elements is greater than the actual
stored data in order to increase and insert elements, which allow direct indexed by serial elements , but the insertion element
prime array elements involved in mobile and other memory operations , so the index data fast and slow insert data , Vector from the
to the use of a synchronized ( thread-safe ) , usually worse performance than the ArrayList , and
LinkedList doubly linked list used for storage , indexed by serial data needs to be forward or backward traversal,
but only need to insert the data recorded before and after the entry of this item can be, so insert faster .
------ Solution ---------------------------------------- ----
not right, it should be ArrayList LinkedList iteration faster than it
------ For reference only ------------------- --------------------
achieved in different ways , linkedList table is even more suitable for a one reads.

------ For reference only ---------------------------------- -----
list algorithm storage
array stores
------ For reference only -------------------------------- -------


Array is an array , it should be faster ah continuous access !

没有评论:

发表评论