If use of hash table is allowed. then it can be done in o(n)

On Fri, Jun 3, 2011 at 12:41 AM, Harshal <[email protected]> wrote:
> @Anurag: XOR wont work here, 1 element is repeated, not 1 element is unique.
> Read the question again.
> Keep inserting elements in a BST and break once you find the same element.
> O(nlogn)
>
> On Fri, Jun 3, 2011 at 12:38 AM, Anurag Narain <[email protected]>
> wrote:
>>
>> take X-OR of all the elements.....the one which has no duplicate will be
>> left and rest all will be reduced to zero.
>>
>> --
>> 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.
>
>
>
> --
> Harshal Choudhary,
> III Year B.Tech CSE,
> NIT Surathkal, Karnataka, India.
>
>
> --
> 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.
>



-- 
Sanjay Ahuja,
Analyst, Financing Prime Brokerage
Nomura Securities India Pvt. Ltd
Powai, Mumbai (400076)

-- 
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.

Reply via email to