title: How to make a list with set(i, ele), add(), remove() methods in O(1)?
body: <p>As title, I want to make a list with <code>set(i, ele)</code>, <code>add(ele) (at front or at the end)</code>, <code>remove(ele) (at font or at the end)</code> in O(1).
  It is easy to make add() and remove() operations in O(1) if we use a linked list. But with a linked list, we cannot access i-th element in O(1).</p>
  <p>According to the comments, I should specify <code>add or remove</code> methods only work at front or at the end.</p>
  <p>Thanks in advance.</p>