What would be the efficient algorithm to find if two given binary trees are equal - in structure and content?
A more general term for what you are probably trying to accomplish is graph isomorphism. There are some algorithms to do this on that page.