I need some help understanding how two tree comparing algorithms differ. I am working with Microsoft’s XmlDiffPatch (http://msdn.microsoft.com/en-us/library/aa302294.aspx) which compares two xmls. The library has some pretty bad documentation IMO however you can find some info here: (http://devproconnections.com/aspnet/compare-and-patch-xml-documents).
Basically it has the option to use two different algorithms for traversing the xml trees. One being: Walk Tree Algorithm: compares node-by-node...
and the other being: The Zhang-Shasha Algorithm: finds the edit distance between trees (ie: how count the minimum number of operations required to transform one string into the other)
.
My issue is, when I pass in an empty source tree to the walk tree algorithm it will fail with a null reference exception however the zhang-shasha can handle it gracefully… I want to find out why this is?
I have stepped through the code and have a very vague understanding of what is going on. I am a visual person and need to look at how these algorithms work via illustrations or at least some more explanation (think back to your data structure classes in school if you ever had them…)