Detect differences between tree structures
This is more of a CS question, but an interesting one : Let's say we have 2 tree structures with more or less the same nodes reorganized. How would you find any in some sense minimal sequence of operations MOVE(A, B) - moves node A under node B (with the whole subtree) INSERT(N, B) - inserts a new node N under node B DELETE (A) - deletes the node A (with the whole subtree) that transforms one tree to the other. There might obviously be cases where such transformation is not possible, trivial being root A with child B to root B with child A etc.). In such cases, the algorithm would simply