Question: Recursive functions of traversal techniques.
0

Recursive functions of traversal techniques:

1. Pre-order traversal:

void Pre-order traversal ( start node * tree)

<

if (tree ! = NULL)

<

print f ("%\t" , tree $\rightarrow$ data);

Pre-order traversal (tree $\rightarrow$ left);

Pre-order traversal (tree $\rightarrow$ right);

3

3

2. In-order traversal:

void Pre-order traversal (struct node * tree)

<

if (tree ! = NULL)

<

Pre-order traversal (tree $\rightarrow$ left);

print f ("/t%d; tree $\rightarrow$ data);

Pre-order traversal (tree $\rightarrow$ right);

3 3

3. Post order traversal:

void Post order traversal (struct node * tree)

<

if (tree ! = NULL)

<

Post order traversal (tree $\rightarrow$ left);

Post order traversal (tree $\rightarrow$ right);

print f ("\t%, tree $\rightarrow$ data);

3

3

renu • 15 views
ADD COMMENTlink
modified 4 weeks ago  • written 4 weeks ago by gravatar for RB RB100
Please log in to add an answer.