P5018 symmetrical binary tree

A water problem. . .

Thinking: precondition symmetrical binary tree has two identical sub-tree nodes, nodes the same two sons values, the same left and right son of the left son son and the right son, the left son of the same left and right son son son right. As long as these conditions are not met within, then it can not be the whole symmetrical binary tree

So we need a first pre-dfs in each subtree rooted at node size, then the recursive processing like. Recursive out to meet the conditions of the updated answer, or continue recursively

Guess you like

Origin www.cnblogs.com/lcezych/p/11116077.html