0

Hi all

during my implementation to tree data structure, I make a method which combine two trees in one tree and called it attach.
I declared 3 trees t1,t2,t3.
and then called method attach which will create new tree and put t1 in right and t2 in left and then store it in t1.
and this method works correctly.(discovered that by debugging)

and then called this method again with t1 and t3

once the compiler enter the this method again t1 becomes null and the program crashes

t.Attach(&t1,&t2);
t.Attach(&t1,&t3);

I don't know what causes this problem.

I'm waiting to any help.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by eman 22
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.