Hey Shashank

Unfortunately I cudnt understand the problem

What do u mean by reversing the tree here :(..

On Tue, Dec 20, 2011 at 11:23 PM, WgpShashank <shashank7andr...@gmail.com>wrote:

> 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to