c# - How Array.Sort sort a class that contains strings and doubles? -


in code i'm looking through writer goes:

individual[] candidates = new individual[tournsize]; (int = 0; < tournsize; ++i) candidates[i] = population[indexes[i]]; array.sort(candidates); 

which property sort if class contains: string s; , double d.

specified in documentation, https://msdn.microsoft.com/en-us/library/6tf1f0bc(v=vs.110).aspx, each element must support icomparable, in case result sorted definitions, , if element doesn't support interface result undefined.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -