
Hi all,
As per definition of Threaded binary tree given below
A binary tree is threaded by making all right child pointers that would normally be null point to the inorder successor of the node, and all left child pointers that would normally be null point to the inorder predecessor of the node.
But in above diagram right child pointers pointing to inorder predecessor and left child pointer pointing to inorder successor ,that making me confuse.
Look at C, what is it's predecessor? Successor? The order is
B then C then D
So B is C's predecessor, D is C successor.
Where does C's left pointer point? B, that's the predecessor, seems good to me.
Likewise, as expected, C's right pointer points to D.
Seems like statement, diagram and logic all agree. Where's the problem?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With