@Marti: If you know m and k, and if m is even and k is odd, then xoring the elements of the array will give the integer that occurs k times. But this is not a general algorithm for arbitrary m and k. Dave
On Sunday, February 24, 2013 1:24:23 AM UTC-6, marti wrote: > A hint is to use XOR for linear time..but how? > > On Friday, February 22, 2013 12:58:07 AM UTC+5:30, marti wrote: >> >> How do I Find the Unique Element that Appears exactly k Times in an Array? >> the problem is given an integer array, only one integer appears* k* times, >> all the other integers appears *m* times in the array (*k*<*m*). Find >> out that integer. >> > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
