i think Return statement will do the job :) On Tue, Jul 12, 2011 at 6:58 PM, anonymous procrastination < [email protected]> wrote:
> Hello, > > Suppose you have to search a particular node in a binary tree. > The code is quite simple. Pick up any traversal and see if any node > matches the value. > Doubt I have is that how to pull out of the recursive function at the > instant node is found. > In iterative algos we use a break. > Here I can use a global flag variable. But any other bettr way of > doing this? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
