> i am looking for the quicker solution...
How quick do you need it to be?
3K isn't much at all to most modern machines.
How do you know this is the problem area - I smell premature optimisation.
How often do you need to calculate the average - once?
How often does the data change?
If the data is pretty uniform, then getting the average of say the first 30 or first 300 (or pick a number) will give you an approximate answer.
But if the data has no useful properties you can make use of, then visiting all 3000 entries is unavoidable.
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.