#include #include #include "data_structures.h" struct node *root = NULL; struct node *create(int val) { struct node *tmp = malloc(sizeof(struct node)); tmp->val = val; tmp->left = NULL; tmp->right = NULL; return tmp; } struct node *insert(struct node *cur, int val) { if (cur == NULL) { return create(val); } if (val < cur->val) { cur->left = insert(cur->left, val); } else if (val > cur->val) { cur->right = insert(cur->right, val); } return cur; }