i want to use a bst for each node of segment tree, then i want to union left bst and right bst into root,,,but when i implement it , it works for root successfully that means it root bst contain all element that left and right bst have and contain the property of bst but the problem is it change the data in left and right child that means for next time if i want to use the left or right bst (not root) it's not the previous bst that means it change with the union operation.
im tried like that
t->bst= unite(t->l->bst ,t->r->bst);
i want to merge the left and right bst in root and also want to the and right bst remain same....
plz anyone explin me how can i do it... thanx in advance