title: C# Sort list while also returning the original index positions?
body: <p>I'm interested in sorting a collection, but also returning an index which can be used to map to the original position in the collection (before the sort).</p>
  
  <p>Let me give an example to be more clear:</p>
  
  <pre><code>List&lt;int&gt; A = new List&lt;int&gt;(){3,2,1};
  List&lt;int&gt; B;
  List&lt;int&gt; idx;
  
  Sort(A,out B,out idx);
  </code></pre>
  
  <p>After which: </p>
  
  <pre><code>A = [3,2,1] 
  B = [1,2,3]
  idx = [2,1,0]
  </code></pre>
  
  <p>So that the relationship between A,B,idx is: </p>
  
  <p><code>A[i] == B[ idx[i] ]</code> , for i = 0...2</p>
  
  <p>Does C#/.Net have any built in mechanism to make this easy to implement?</p>
  
  <p>Thanks.</p>