Tree matching works on tree structure instead of postorder