So I'm having some discrete elements X1,X2,...,Xn with positive weights Wi (all weights sum up to 1). The weighted average is an element Xk that:
What I want is an algorithm to calculate that Xk in O(nlogn) time with the use of sorting algorithm.
Any ideas to give me a boost? I don't want the whole solution, just something to get it started.