Request, what is the algorithm can be used for such problems
CodePudding user response:
Starting from an arbitrary object, breadth traversal of all objects until they can not find a new object, then output the whole tree node, to the output nodes on the same treatment again, until all nodes output,