could anybody help me with the following task:
i have an array of data: adata[n].
now (at least) k elements of this array are equal, but i don't know which. comparing two elements is very time expensive, so i want to do this task with comparing as little elements as possible.
how could i get the indices of the equal elements?
k is greater than n/2, so that there can only be one solution.
also k elements of the elements should be equal, but this is not sure.
it should also be possible to determine fast if there are (at least) k equal elements in the array.
Thanks for your help.