title: Time Complexity for Java ArrayList
body: <p>I found other entries for this question that dealt with specific methods, but nothing comprehensive. I'd like to verify my own understanding of the most often used methods of this data structure:</p>
  
  <p>O(1) - Constant Time:</p>
  
  <pre><code>isEmpty()
  add(x)
  add(x, i)
  set(x, i)
  size()
  get(i)
  remove(i)
  </code></pre>
  
  <p>O(N) - Linear Time:</p>
  
  <pre><code>indexof(x)
  clear()
  remove(x)
  remove(i)
  </code></pre>
  
  <p>Is this correct? Thanks for your help.</p>