I think use bfs ... On Thu, Jul 29, 2010 at 11:26 AM, irfan naseef <irfannase...@gmail.com>wrote:
> > > On Thu, Jul 29, 2010 at 11:35 PM, ashish agarwal < > ashish.cooldude...@gmail.com> wrote: > >> please explain q ..i didnt understand >> >> >> On Thu, Jul 29, 2010 at 11:01 AM, irfan <irfannase...@gmail.com> wrote: >> >>> I attended Amazon placement test today . There was a question where i >>> got confused.It is as follows. >>> >>> Give an algorithm to connect all nodes in one level of a binary tree . >>> >>> 5 >>> 5 >>> / >>> \ / \ >>> 8 2 --------> 8 ---- >>> > 2 >>> / \ / / >>> \ / >>> 1 2 6 1 ---> 2 -->6 >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algoge...@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > Sorry for that. I attached a jpg file showing what shud the algo do . > Question is that, we are given a tree. algo shud connect all the nodes > which are in same level. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@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.