STARTING OUT WITH C++ MPL
STARTING OUT WITH C++ MPL
9th Edition
ISBN: 9780136673989
Author: GADDIS
Publisher: PEARSON
Question
Book Icon
Chapter 19.2, Problem 19.8CP
Program Plan Intro

Tree Traversal:

Traversal is a process of visiting the nodes that are present in the tree that are connected via edges. A node that is present in the tree cannot be visited randomly; it requires traversal techniques that are listed below:

In order traversal:

The traversal takes place from the left sub-tree towards root node and towards the right sub-tree.

Preorder traversal:

The traversal takes place from the root node towards left sub-tree and towards the right sub-tree.

Post order traversal:

The traversal takes place from the left sub-tree towards right sub-tree and towards the root node.

Blurred answer