• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "bin-trees.h"
4 
5 static void
real_preorder(tree_ptr root)6 real_preorder (tree_ptr root)
7 {
8   if (root == NULL)
9     return;
10 
11   printf ("%d ", root->data);
12   real_preorder (root->left);
13   real_preorder (root->right);
14 }
15 
16 
17 void
pre_order_traverse(tree_ptr root)18 pre_order_traverse (tree_ptr root)
19 {
20   printf ("pre-order traversal, with recursion: \n");
21   real_preorder (root) ;
22   printf ("\n");
23 }
24