Preorder traversal of a binary tree
struct NODE
{
struct NODE *left;
int value; /* can take any data type */
struct NODE *right;
};
preorder(struct NODE *curr)
{
printf("%d", curr->value);
if(curr->left != NULL) preorder(curr->left);
if(curr->right != NULL) preorder(curr->right);
}