Created
May 10, 2012 08:04
-
-
Save Tak/2651817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Sort | |
{ | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
var list = new List<int> () { | |
1, 3, 5, 7, 2, 4, 6, 8 | |
}; | |
PrintCollection (list); | |
list.Sort ((a,z) => a.CompareTo (z)); | |
PrintCollection (list); | |
} | |
static void PrintCollection<T> (IEnumerable<T> collection) | |
{ | |
foreach (T blah in collection) | |
Console.Write ("{0} ", blah); | |
Console.WriteLine (string.Empty); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment