<p>This is an exercise for the CS guys to shine with the theory.</p>

<p>Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter.</p>

<p>What is AN algorithm to calculate the added and the removed?</p>

<p><strong>Notice</strong>: If there are many ways to solve this problem, please post one per answer so it can be analysed and voted up.</p>

<p><strong>Edit</strong>: All the answers solve the matter with 4 containers. Is it possible to use only the initial 2?</p>

I have not done this in a while but I believe the algorithm goes like this...
```
```
sort left-list and right-list
adds = {}
deletes = {}
get first right-item from right-list
get first left-item from left-list
while (either list has items)
  if left-item < right-item or right-list is empty
    add left-item to deletes
    get new left-item from left-list
  else if left-item > right-item or left-list is empty
    add right-item to adds
    get new right-item from right-list
  else
    get new right-item from right-list
    get new left-item from left-list
```
```
In regards to right-list's relation to left-list,
deletes
contains items removed and
adds
now contains new items.