My code goes well and show correct result when i click run code. But when i try to submit , it turns out to be wrong. However, when input the testcase in the "Wrong answer", it still goes correctly in "Run code". For now, i have came cross two of this situations. One is "Subtree of Another Tree", the other is "Symmetric Tree ".
I am a noob to Java. It should be my code that caused this problem, but i think at least the result of "Run code" and "Submit" should be the same, i guess.
Here are two pics explaining what happened.

/////

Waiting for a solution.
Thanks!