@sharad Your approach limits the size of array to be very small(as well as
the elements of the array to be small).Else the product will become too big
to be held in an array.Same applies with samm's solution too though in his
case we can be more liberal with element's value......


Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com



On Wed, Jan 4, 2012 at 11:11 AM, sharad dixit <[email protected]>wrote:

> Can we use concept of prime number as fundamental theorem of arithmetic
> i.e every number has a unique factorization into primes (
> http://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic) and then
> multiply them together.
>
> e.g
>  A1[3] = { 2,3,4}   =>  secondprime*thirdprime*forthprime = 2 * 3 * 5 = 30
>  A2[3] = { 3,2,4}   =>  3rdprime * 2ndprime* 4thprime = 3 * 2 * 5 =30
>
> On Wed, Jan 4, 2012 at 11:00 AM, rahul patil <
> [email protected]> wrote:
>
>>
>> @samm: Rather than adding numbers could we add squares(or cube) of
>> numbers which could also be done in linear time?
>>
>>
>> On Wed, Jan 4, 2012 at 10:56 AM, rahul patil <
>> [email protected]> wrote:
>>
>>> @samm: Ur solution is great. It could be used to tell that arrays are
>>> not similar, in linear time. But cant tell that they are 100% similar
>>> ur solution fails for the simple case.
>>> arr1: 3,4
>>> arr2: 5,1
>>>
>>> On Wed, Jan 4, 2012 at 10:49 AM, SAMMM <[email protected]> wrote:
>>>
>>>> No it's not if u use the AP series mathematical formula n(n+1)/2..
>>>> Then it will be of O(n).
>>>>
>>>> --
>>>> 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.
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards,
>>> Rahul Patil
>>>
>>
>>
>>
>> --
>> Regards,
>> Rahul Patil
>>
>> --
>> 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.
>>
>
>
>
> --
> -Sharad Dixit
>  B.Tech(IT)
>  Indian Institute of Information Technology Allahabad
>
> -----------------------------------------------------------------------------------------------------------------------------
> "We aim above the mark to hit the mark."
> ~ Ralph Waldo Emerson
>
>  --
> 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.

Reply via email to