Hi, @hjy06, great code! Well, the following line is redundant.TreeNode left = null;
BTW, the following linelklist.push(cur);
may not be obvious for programmers in other languages, especially C++, whose push are pushing to the end while the push of LinkedList pushes to the beginning. The above line is actually the same to lklist.addFirst(cur);.