This is my Bag implementation, which just extends ArrayList and overrides the remove method. Note that this class only sets indices to null, this is to avoid getting a ConcurrentModificationException while looping through with a for-each loop. After your foreach loop ends, just call remove(null) and all the nulls will removed from the list.
Bag :: fast insert, fast remove
This Bag is an unordered list. Putting an element will append it to the backing array. Taking an element will move the last element in the a...