What is a forest walk

Can someone explain this in detail? (this is a forest, not a binary tree) I read the chapter of the tree and the forest in the data structure book, I knew the walk in the order and in the order of passage of the forest.

+4
source share
1 answer

Post crawl is a kind of method for exploring your tree or forest.

in detail, a crawl message means that you are exploring the nodes closest to the sheet, including the sheet itself.

In action; you should always go to your first or leftmost node until the current node has no child. if this happens, you do your actions with a note, go to your parent, go to "his next son", and you continue to delve into this node, the repulsive process (first left child, etc.).

Here is an image that can help you understand.

0
source

Source: https://habr.com/ru/post/1568592/


All Articles