19. The next node binary tree

 

1. If a node has a right child, then it's the next node is the leftmost child node of its right subtree.

2. If the current node does not have the right son, we can always point to traverse up the parent node pointers until it finds a node is left child node of its parent node.

 

 

Guess you like

Origin www.cnblogs.com/make-big-money/p/12585200.html