@gopi inserting n elements, and then again checking each element? nlogn?? On Sun, Jul 31, 2011 at 9:04 PM, Anika Jain <[email protected]> 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, *$* <[email protected]> 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 >> <[email protected]>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 [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. >>> >> >> >> >> -- >> 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 [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. >> > > -- > 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. > -- 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 [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.
