title: Structure that allows duplicates, maintains insertion order and allows removal and insertion
body: <p>I am looking for a data structure that allows duplicates and maintains insertion order so that if given file input of : <code>a + a + b = c</code></p>
  
  <p>So that once correctly split, I will get: <code>{a,+,a,+,b,=,c}</code></p>
  
  <p>This data structure also needs to allow for removal and insertion in the correct order, for example if I replace <strong>a</strong> with <strong>d</strong>, I should get <code>{d,+,d,+,b,=,c}</code>.</p>
  
  <p>Finally the structure must also be able to recognize which items are before or after a certain item. E.g. the item directly before <strong>=</strong> is <strong>b</strong> and directly after is <strong>c</strong>.</p>
  
  <p>I am aware that lists allow duplicates and some lists maintain insertion order, but I am unsure as to which will allow me to achieve my goals.</p>
  
  <p>If you are aware of a structure the will achieve all of the above, please provide the syntax for creating such a structure.</p>
  
  <p>Regards</p>