preorder traversal of a binary treestruct


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);

}

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: preorder traversal of a binary treestruct
Reference No:- TGS0263978

Expected delivery within 24 Hours