Binary Tree Traversal Inorde Sit
Binary Tree Traversal Inorde Sit
h>
#include <stdlib.h>
struct Node {
int data;
struct Node* left;
struct Node* right;
};
// Empty Tree
if (root == NULL)
return;
node->data = data;
node->left = NULL;
node->right = NULL;
return node;
}
int main() {
struct Node* root = newNode(1);
root->left = newNode(2);
root->right = newNode(3);
root->left->left = newNode(4);
root->left->right = newNode(5);
printf("Inorder traversal: ");
inorderTraversal(root);
printf("\n");
return 0;
}