This has always lingered in the back of my mind, so I figure I might as well go ahead and ask.
How does a wiki handle multiple edits on the same content?
Here\'s
How does a wiki handle multiple simultaneous edits?
That depends on the implementation of the wiki.
Is there a diff / merge algorithm that could be used for this?
Any merge algorithm that meets your requirements will do.
Generally it depends on the behavior you like the wiki to have. For example, you may choose to implement your wiki in such a way that Person Two's change won't be committed as the article has been modified and Person Two is working on an outdated base copy. Potentially Person Two would enter something completely different if he/she was aware of the changes. In that case you may choose to not allow committing Person Two's changes. This can be achieved with the transactional mechanism Kurt Du Bois mentions in his answer.
Another option would be to implement an approach that always allows saving the wiki article. In this case you may lose the changes of Person One while in the first approach you would lose the changes of Person Two.
A third approach would be to present both articles side-by-side in a merge window. I am not aware of a wiki that supports this. If it did I was wondering what would happen if co-incidentally three (or more) people are modifying the same document.
So if you are using a wiki, I'd suggest to keep edits small.
If you are implementing a wiki, you have a choice of how you want your wiki system to behave.