@All

Sry for late reply .. I was offline for sometime .


Just wanted to brief why I had come up of having a cummulative sum of
each elements of the array . As I mentioned the Frequency distribution
of the numbers ..
I meant that to the frequency the elements of the array starting from
1 to element Positive element N or from -1 to Negative Element to
Negative N .

For Example :--

Array :- [ 2 , 3 ,3 , 5 , 4 ]

I would have a piles starting from 1 to max(array) here 5 .

So after a,
 2 <=> 1+2
 3 <=>1+2+3
 3 <=>1+2+3
 5 <=> 1 +2 +3+4+5
 4 <=> 1+2+3+4

Now track the count of every numbers .

There are 5 one's , 5 two's , 3 three's , 2 fours and 1 five.

So our next task is to check for this counts WITH the other array .
And this should work of both +ve and -ve element array .

Initially I was adding them up but it failed , but this would suffice I guess ..
The only Concern is Space here  , But in order to get something need
to compromise sometime else .

On 1/8/12, sravanreddy001 <[email protected]> wrote:
> @shashank:  your approach fails for (2,0,0,0) & (1,1,1,1)
>
> but.. from any of the above approaches seen, we couldn't be 100% sure of
> the solution,
> but, from shashank's approach, the probability of finding correct soultion
> can be improved by using some random prime numbers.
> (running tests for more than one prime number)
>
> and for any other approaches, a mathematical proof is needed to support the
> answer.
>
> (better accuracy over time is the trade off in the seen examples)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/z-3GHpDXLFoJ.
> 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.
>
>


-- 
Somnath Singh

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