@gopi inserting n elements, and then again checking each element? nlogn?? On Sun, Jul 31, 2011 at 9:04 PM, Anika Jain <anika.jai...@gmail.com> wrote:
> @gopi: in 2nd of urs we after tree creation we will need to search each > element in array that will take o(nlogn) time.. is there any appraoch tht > reduces this? > > > On Sun, Jul 31, 2011 at 6:39 PM, *$* <gopi.komand...@gmail.com> wrote: > >> >> >> Q1->Construct a binary tree , in such a way that if element occured for >> the first time , insert into tree , if occurs at second time , remove from >> the list. >> As all elements except the one need to find are even , at the end of the >> list , all the tree will contain only one element. >> >> Q2-> Construct a binary tree. similar to the above. >> Now again start from first element and check which element is missing in >> the tree. That is the required one. >> >> >> Thx, >> --Gopi >> >> >> On Sun, Jul 31, 2011 at 2:07 PM, Abhishek Gupta >> <gupta.abh...@gmail.com>wrote: >> >>> Q1-> A large size array is given. All except one element are repeated >>> even no. of times and one element is repeated odd no. of times. Find that >>> element. Don't use X-OR >>> >>> Ans -> Is there any efficient way of finding it without using sorting or >>> removing duplicates or using hash tables?? >>> >>> >>> >>> Q2-> Same qn is like all except one are repeated off no. of times and one >>> element repeated even no. of times. find that element. (no specification for >>> X-OR use given) >>> >>> Ans-> Again, I tried it using hash table. >>> >>> >>> -- >>> Abhishek Gupta >>> MCA >>> NIT Calicut >>> Kerela >>> >>> -- >>> 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. >>> >> >> >> >> -- >> Thx, >> --Gopi >> >> -- >> 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. >> > > -- > 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. > -- Abhishek Gupta MCA NIT Calicut Kerela -- 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.