A: 
Michał Piaskowski
A: 

First, do yourself a favor and use the generic version of List, so define your objectList as

static List<MyClass> objectList;

But, in either case, since a List is a collection of references to the actual objects, and since you seem to want to have the two lists in the same order, why not just assign one list to the other? What am I missing?

WaldenL
The sorted list doesn't contain actual objects. It only contains values used for sorting.
Michał Piaskowski
A: 

It sounds like you want a map instead:

static Dictionary<int, MyClass> sortedObjectList
Nikhil Chelliah
+1  A: 

Break it into steps:

  1. Go through your sortedValuesList and build a map from values -> index positions; this is O(n log n)
  2. Go through your objects and add the index in a temporary field (again, O(n log n))
  3. Sort your list by the temporary field (also O(n log n))

Total algorithm, O(n log n).

Alternatively, if you don't want to have the scratch field, you can look up the sort key via the map each time for an overall O(n (log n)^2)

MarkusQ