Skip to content

Instantly share code, notes, and snippets.

@Tak
Created May 10, 2012 08:04
Show Gist options
  • Save Tak/2651817 to your computer and use it in GitHub Desktop.
Save Tak/2651817 to your computer and use it in GitHub Desktop.
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