What ist the fastest way to iterate a list of elements where each item has an associated "score" and items with hightest score come first.
Example:
List<X> items = new List<X>(new X[]{a,b,c,d});
int[] score = new int[]{20,301,-34,7};
foreach(X x in IterateByScore(items,score)) { // <-- Fastest way to do this?
// order should be b - a - d - c
}
Edit: The first example used an order list which could be used as indices, but I have a list of "scores". Please excuse the mistake.