Given two unsorted arrays of size N each, we are to determine if the Binary Search Tree constructed from them will be equal or not.
So, the elements of
Try this:
int identical(struct node* a, struct node* b) { if (a==NULL && b==NULL) { return(true); } else if (a!=NULL && b!=NULL) { return(a-> data == b-> data && identical(a->left, b->left) && identical(a->right, b->right)); } else return(false); }