Sunday, November 16, 2008

How to Print a data from a binary tree In ascending order

Code snippet to Print a data from a binary tree – In-order(ascending)


// recursive version


Void PrintTree ( struct * node node )
{
if ( node == NULL )
return;

PrintTree(node - > left );
Printf(“%d”, node - > data);
PrintTree(node - > right );
}

0 comments: