I think its the right most element of the left sub-tree and not the left child itself, if the node has a left child.

and if it doesn't have a left child then travers up towards the root. the first node x you hit which is the right child of its parent, then parent(x) is the answer.

and I agree with Arunachalam, Google is really helpful in these issues. Please use it properly. rather just use it. It'll take care of the rest!

-Vijju

On 6/8/06, Arunachalam <[EMAIL PROTECTED]> wrote:
1. Yes
2. Inorder Predecessor of a node(A) is the node(B) which appears before this node(A) in the inorder traversal.
 
If the current node has left child then the left child is the inorder predecessor.
If it does not have the left child traverse the parent(Y) until the parent node(Y) is the right child of some node X. Then X is the inorder predecessor.
 
You should be easily able to search this data in the internet. Please do search the internet before posting this simple questions.
 
regards
Arunachalam.
 
On 6/8/06, Sriram narasimhan <[EMAIL PROTECTED] > wrote:
hi everyone,
                  1.Can topological sorting be stated as an application of depth first search(DFS)...
                  2.What is inorder predecessor?how wil i find it???
 
pls reply....
 
Sriram






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to