[algogeeks] Merging companies

2009-08-24 Thread ankur aggarwal
Merging companies Suppose we have N companies, and we want to eventually merge them into one big company. How many ways are there to merge? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To p

[algogeeks] Re: find elements in array with odd frequency

2009-08-24 Thread Anil C R
Its straight forward if the range of the array elements is bounded. or you could hash a number (key) and its frequency (value) in a hash table this would give you almost O(n) complexity. On Mon, Aug 24, 2009 at 1:00 PM, Nagendra Kumar wrote: > > Plz write the code here. > > On Sun, Aug 23, 2009 a

[algogeeks] Re: find elements in array with odd frequency

2009-08-24 Thread Nagendra Kumar
Plz write the code here. On Sun, Aug 23, 2009 at 2:30 PM, Dufus wrote: > > Idea is simple either to keep a count and emit elements with odd count > (frequency) or XOR element with itself for each time it occurs in > input and then emit elements which have non zero XORed result(which > basically c

[algogeeks] Re: find elements in array with odd frequency

2009-08-24 Thread Geoffrey Summerhayes
On Aug 23, 5:00 am, Dufus wrote: > Idea is simple either to keep a count and emit elements with odd count > (frequency) or XOR element with itself for each time it occurs in > input and then emit elements which have non zero XORed result(which > basically corresponds to elements with odd freque