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


I don't know what causes this problem.

I'm waiting to any help.