Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

index sort

Array.Sort<int>(index, (a,b) => anylist[a].CompareTo(anylist[b]));
// index is the same size as anylist, initialized with 0,1,2,3,... etc.
// The order of elements in anylist is not changed.
// However anylist[index[i]] yields sorted values for i=0,1,2,3,... etc. 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #index #sort
ADD COMMENT
Topic
Name
5+9 =