title: Performance differences between ArrayList and LinkedList
body: <p>Yes, this is an old topic, but I still have some confusions.</p>
  
  <p>In Java, people say:</p>
  
  <ol>
  <li><p>ArrayList is faster than LinkedList if I randomly access its elements. I think random access means "give me the nth element". Why ArrayList is faster?</p></li>
  <li><p>LinkedList is faster than ArrayList for deletion. I understand this one. ArrayList's slower since the internal backing-up array needs to be reallocated. A code explanation:</p>
  
  <pre><code>List&lt;String&gt; list = new ArrayList&lt;String&gt;();
  list.add("a");
  list.add("b");
  list.add("c");
  list.remove("b");
  System.out.println(list.get(1)); //output "c"
  </code></pre></li>
  <li><p>LinkedList is faster than ArrayList for insertion. What does insertion mean here? If it means to move some elements back and then put the element in the middle empty spot, ArrayList should be slower than LinkedList. If insertion only means an add(Object) operation, how could this be slow? </p></li>
  </ol>