Bug fixed:

- secondNode = pre;
+ secondNode = root;

Run Status: Accepted!
Program Runtime: 12 milli secs
Progress: 20/20 test cases passed.

Run Status: Accepted!
Program Runtime: 268 milli secs
Progress: 2516/2516 test cases passed.