Hi ,

First Identify the leaf nodes: Have an array or list. keep populating
the pointer to left child into the list in the same order as they
come.
When you encounter the first duplicate, You know the nodes between the
2  duplicates (including the duplicate) are the leaf nodes.

Now recursively scan the left and right subtree , like its done in
trivial way to find the height of tree and as you proceed check if the
node pointer is present in the array as defined above and use that
condition to terminate the recursion

Is this an acceptable solution ?


--

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.


Reply via email to