Successor nodes of a binary tree search
Users questions: The figure inside: Why is the successor of key 15 keywords 17 nodes? How do I find it? 13 keywords is not the right subtree of the node, its successor to its lowest ancestor? The ancestors of the left child is also ancestor. Which refers to the lowest node? Who are its ancestors? Follow-up question like this to find it What you thought it
Experts answer: in-order traversal of this algorithm is in-order traversal is to visit the left child node (including the entire sub-tree), then visit the node, and finally access the right child nodes (including whole grain sub-tree) on top of that figure with your , the traversal order is 2-3 -4-6-7-9-13-15 -17-18-20 Its central idea is: the left subtree - root - assuming the right sub-tree nodes in the left sub-tree has a left and right node b, then the above sequence is a-left-left sub-tree node - the right node b-root - the right subtree and then continue to assume that the right subtree of left and right node c node d, then the sequence is left A-left sub-tree node - right b-root node - the node c-right-left sub-tree - right node d (PS: I can only explain to this extent.... Can not read the words that you can only slowly pondering, and no quick fix to)