@ srikant , trhe structure of binary tree have to be modified for this solution right..as nodes may have 3 links
On Fri, Jul 30, 2010 at 12:03 AM, ashish agarwal < [email protected]> wrote: > I think use bfs ... > > On Thu, Jul 29, 2010 at 11:26 AM, irfan naseef <[email protected]>wrote: > >> >> >> On Thu, Jul 29, 2010 at 11:35 PM, ashish agarwal < >> [email protected]> wrote: >> >>> please explain q ..i didnt understand >>> >>> >>> On Thu, Jul 29, 2010 at 11:01 AM, irfan <[email protected]> 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 [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<algogeeks%[email protected]> >>>> . >>>> 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 [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<algogeeks%[email protected]> >>> . >>> 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 [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<algogeeks%[email protected]> >> . >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- With Regards, Jalaj Jaiswal +919026283397 B.TECH IT IIIT ALLAHABAD -- 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.
