title: Which one runs faster, ArrayList or LinkedList?
body: <pre><code>List li = new LinkedList();
  
  for (int i = 0; i &amp;lt; 100; i++) {
      li.add(i);
  }
  
  long start1 = System.nanoTime();
  li.get(57);
  
  long end1 = System.nanoTime();
  long diff1 = end1-start1;
  
  System.out.println("Time taken by LinkedList = "+diff1);
  
  List al = new ArrayList();
  for (int i = 0; i &lt; 100; i++) {
      al.add(i);
  }
  </code></pre>
  
  <p>What ever operations I perform on both the lists, when I print out the time taken,  ArrayList always runs faster than LinkedList. 
  Can somebody explain which performs better in terms of time taken?
  Also let me know if there is something wrong in the code. Thanks!</p>