here is my code
List<Node> list=new LinkeList<Node>();
public List<Node> reverseTreeandReturnListContainingAllLeafNOdes(Node n)
{
int i=0;
static int j=0;
if(n==null)
{
n=n.children[++j];
return null;
}
if(n.children[i]==null)
{
list.add(n);
return list;
}
list=reverseTreeandReturnListContainingAllLeafNOdes(n.children[i]);
n.children[i]=n;
return list;
}
may contains the bug ? any modification / suggestion will be appreciated
Thanks
Shashank
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/2puK42n-1yYJ.
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.