- Sort the array - o(log n) based on the sorting strategy might be radix
   sort
   - check the numbers count have a counter o(1) space and again o(n) time
   - changing from one number to other check counter%2 == 0 if so then we
   get answer

So consolidated time would be o(n) and space is o(1);

On Tue, Aug 16, 2011 at 3:20 PM, MAC <[email protected]> wrote:

> The question needed o(1) space and o(n)  time ...  o(n) map approach is
> obviously fine but space is taken up ...
>
>
> On Tue, Aug 16, 2011 at 2:38 PM, Raghavan <[email protected]> wrote:
>
>> @sukran:
>> If you were asking for the map based solution
>>
>> space and time complexity would be o(n).
>>
>>
>> On Tue, Aug 16, 2011 at 2:34 PM, sukran dhawan <[email protected]>wrote:
>>
>>> what is the complexity in which it has been done ?
>>>
>>> On Tue, Aug 16, 2011 at 1:41 PM, MAC <[email protected]> wrote:
>>>
>>>>
>>>> Given an array of integers. Each number in the array repeats ODD number
>>>> of times, but only 1 number repeated for EVEN number of times. Find that
>>>> number.
>>>>
>>>>
>>>> --
>>>> thanks
>>>> --mac
>>>>
>>>>  --
>>>> 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.
>>>
>>
>>
>>
>> --
>> Thanks and Regards,
>> Raghavan KL
>>
>>  --
>> 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.
>>
>
>
>
> --
> thanks
> --mac
>
>  --
> 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.
>



-- 
Thanks and Regards,
Raghavan KL

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