title: What is the best data structure for removing an element from the middle?
body: <p>The data stucture must be like a stack. Only with one difference. I want to pop from any index not only last. When I have popped element <code>n</code>, the elements with indexes <code>N &gt; n</code> must swap to <code>N-1</code>. Any ideas?</p>
  
  <p>P.S. </p>
  
  <ol>
  <li>Pushing element <code>n</code> into the last index of the stack. </li>
  <li>Then popping it out. </li>
  <li>Then deleting <code>stack[n]</code></li>
  </ol>
  
  <p>is a bad idea. </p>