Is the second array really required, assuming intersection of both A & B is equal to either A or B?
How about X[a[i]] = i? On 27 December 2010 21:24, Anand <anandut2...@gmail.com> wrote: > I have a two arrays > > One is > > 2 5 1 6 4 3 > > other is > > 1 2 3 4 5 6. > > I want to make an array X which gives the index of its element on other > arrays. > > Meaning X[1] = 3 1 is element of the second array and 3 is the index of > element 1 in first array. > > How shall we get array X in O(nlogn). > > -- > 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. > -- regards, soumya prasad ukil -- 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.