Suppose the lowest-key items are to be removed first.
We can use an array sorted by key:
Note that only the key is shown. Each item's data would also be stored in the array.